Complete Feature Reference
One page that documents everything Discount Rules Box can do — every setting, every pricing model, every shortcode and every developer hook.
Table of Contents
- Installation & Requirements
- Dashboard Overview
- Pricing & Tiers
- Appearance & Customization
- Display Elements
- Texts, Badges & Translation
- Placement & Shortcodes
- Cart, Checkout & Order Meta
- Analytics & Reporting
- Free vs Pro
- Compatibility & Technical Notes
- Developer Hooks
- Related Docs
1. Installation & Requirements
The plugin runs on top of WooCommerce. If WooCommerce is not active, the plugin refuses to activate and shows a clear message.
| Requirement | Minimum |
|---|---|
| WordPress | 6.4 or later (Requires at least) |
| PHP | 8.0 or later |
| WooCommerce | 7.0 or later (WC requires at least) |
| Tested up to | WooCommerce 9.5 |
- WooCommerce dependency: the plugin declares
Requires Plugins: woocommerce. During activation,drbu_activate()checks for an active WooCommerce (including network-activated on multisite) and deactivates the plugin with a notice if it is missing. - HPOS ready: on
before_woocommerce_initthe plugin declares compatibility with WooCommerce Custom Order Tables viaFeaturesUtil::declare_compatibility( 'custom_order_tables', … ), so it is safe to enable HPOS. - Activation: upload the ZIP under Plugins → Add New → Upload Plugin, or copy the folder to
/wp-content/plugins/and activate. See the Quick Start Guide. - Text domain:
discount-rules-box-upsell— the plugin is fully translatable through standard WordPress language packs.
2. Dashboard Overview
After activation, all settings live under WooCommerce → Discount Rules Box. There is also a dedicated reporting page under WooCommerce → DRBU Analytics. Both require the manage_woocommerce capability.
Five tabs, one form
| # | Tab | What it controls |
|---|---|---|
| 1 | Tiers & Pricing | Number of tiers, the 4 pricing models, discount unit, per-tier quantities, labels, notes and amounts. |
| 2 | Appearance & Styles | 7 style presets, brand colors, button/card corner radiuses. |
| 3 | Display Options | Which buy box elements are visible: free shipping, footer badges, savings, best value, per-unit and strikeout price. |
| 4 | Texts & Badges | 1-click language presets (13 languages) and every editable string, package title and note. |
| 5 | Integration | Product page display, replace Add to Cart, category popup, hide default price, product & category restrictions. |
Built-in tools
- Live Preview: a sticky right-hand panel renders the exact frontend buy box in real time as you change any setting. Toggle between desktop and mobile views. You can enter a demo product base price (default
$18.00) to preview realistic math. - Reset to Defaults: one click restores every parameter and style to factory defaults.
- AJAX product search: in the Integration tab, search products by name or ID while typing (protected by a WordPress nonce) to build restriction lists.
- Settings shortcut: a “Settings” link is added to the plugin row on the Plugins page.
[tiered_buy_box] shortcode.3. Pricing & Tiers
The core feature: the buy box offers 2 or 3 packaging tiers (e.g. 1, 2 and 3 pieces). Each tier has its own quantity, title, note and discount value. All math runs centrally in DRBU_Pricing_Engine, so the displayed price always matches the cart price.
Number of packaging tiers
- 2 Tiers — packs of 1 and 2 pieces (maximum in the Free version).
- 3 Tiers — packs of 1, 2 and 3 pieces (Pro feature).
The 4 pricing models
Examples below use a base price of $18.00 per piece, tier 2 discount 40% and tier 3 discount 25% (percentage unit).
🎯 Model A — Discount on Additional Items
The discount applies only to the 2nd and 3rd piece; the 1st piece always costs the full price. 2 pieces: $18 + $10.80 = $28.80 total ($14.40/unit). 3 pieces: $18 + $10.80 + $13.50 = $42.30 total ($14.10/unit). The recommended model for driving buyers to 2+ pieces.
🏷️ Model B — Discount on Entire Quantity
The discount applies to every item in the pack. 2 pieces at 40% off: $36 × 0.60 = $21.60 total ($10.80/unit). 3 pieces at 25% off: $54 × 0.75 = $40.50 total ($13.50/unit).
💵 Model C — Fixed Total Bundle Price
You set an exact fixed total for each pack. E.g. Tier 1 = $18.00, Tier 2 = $28.80 total, Tier 3 = $39.99 total. Perfect for psychological pricing like $39.99.
🏷️ Model D — Fixed Price Per Unit
You set an exact price per single item per tier. E.g. Tier 2 = $14.40/unit → $28.80 total, Tier 3 = $13.50/unit → $40.50 total. The pack total is simply unit price × quantity.
Discount unit
- Percentage (%) — the tier value is a percent off the base price.
- Fixed amount ($) — the tier value is subtracted from the base price per discounted item.
Per-tier configuration
Each tier row stores:
| Field | Meaning | Default |
|---|---|---|
| Quantity (pcs) | Pieces in the pack | 1 / 2 / 3 |
| Package title | Shown on the pack card, supports {qty} | “1 piece”, “2 pieces”, “3 pieces” |
| Note / description | Subtitle on the pack card, supports {d2}, {d3}, {save}, {qty}, {price} | “Second item − {d2} · {save}” |
| Discount / fixed price | Percent or amount (Model A/B), fixed pack total (Model C) or fixed unit price (Model D) | 0 / 40 / 25 |
Best value badge
Choose which tier carries the “Best Value” badge and is pre-selected in the buy box (drbu_best_value_index, default = tier 2). The badge color is configurable.
Currency display
- Default — standard WooCommerce formatting (uses the store currency symbol and position automatically).
- Hide zeros — whole amounts display without decimals (e.g. $18 instead of $18.00).
4. Appearance & Customization
7 style presets (one-click themes)
| Preset | Primary | Button radius | Card radius |
|---|---|---|---|
| Warm Rose Gold (Default) | #c49186 | 100px (Pill) | 16px |
| Amazon Orange | #ff9900 | 100px | 16px |
| Sunny Yellow | #ffd814 | 100px | 16px |
| Ocean Royal Blue | #0070ba | 100px | 16px |
| Modern Blue | #2563eb | 14px (Rounded) | 12px |
| Emerald Fresh | #10b981 | 100px | 16px |
| Energy Red (Sharp) | #dc2626 | 0px (Sharp) | 0px |
Custom colors
- Primary color — buttons, radio selection and accents (
drbu_primary_color). - Button text color — CTA text (
drbu_cta_text_color). - “Best Value” badge color (
drbu_best_value_color). - Card background — the tier card fill (
drbu_card_bg_color).
Corner radiuses
- Button: Pill 100px · Rounded 14px · Soft 8px · Sharp 0px.
- Card: 16px · 12px · 6px · 0px.
How styling is applied
The plugin injects a small inline CSS block (dynamic_css()) that sets CSS variables on :root: --drbu-primary, --drbu-primary-hover, --drbu-primary-soft, --drbu-primary-rgb, --drbu-cta-text, --drbu-best-value, --drbu-card-bg, --drbu-btn-radius, --drbu-card-radius. The static stylesheet reads them, with safe fallbacks, so the buy box works even without the inline style. Hover and soft shades are derived automatically from the primary color.
5. Display Elements
Toggle every element of the buy box from the Display Options tab. Disabled elements are hidden together with their related settings.
| Option | Default | What it does |
|---|---|---|
| Show free shipping | Pro: on / Free: off | Shows a shipping status line per pack and a ✓ free-shipping badge on qualifying packs, based on the free shipping threshold. |
| Free shipping threshold | $50 | A pack is marked “Free shipping” when its total reaches this amount. |
| Show footer badges | On | Renders trust badges (one per line, with a checkmark icon) below the CTA button. |
| Show savings | On | Displays the saved amount on each pack and on the cart line item. |
| Show best value badge | On | Highlights the recommended tier with the “Best Value” badge. |
| Show per-unit price | On | Shows the price per piece (e.g. $14.40 per unit) next to the headline price and on each pack. |
| Show strikeout price | On | Strikes the original price next to the discounted pack price (was price). |
6. Texts, Badges & Translation
1-click language presets
The Texts & Badges tab can fill every label automatically with high-converting translations:
- 🇬🇧 English (Global) · 🇪🇸 Español · 🇩🇪 Deutsch · 🇫🇷 Français · 🇮🇹 Italiano
- 🇧🇷 Português (Brazil) · 🇷🇺 Русский · 🇮🇳 हिन्दी · 🇳🇱 Nederlands
- 🇵🇱 Polski · 🇷🇴 Română · 🇭🇺 Magyar · 🇷🇸 Srpski / Hrvatski / Bosanski
Every field remains 100% customizable after applying a preset.
All editable strings
| Setting | Default (English) |
|---|---|
| best_label | Most Popular |
| in_stock_label | In stock |
| per_unit_label | per unit |
| total_label | total |
| pack_total_label | for {qty} pieces · total |
| savings_label | savings |
| ship_free_text | Free shipping included in this pack |
| ship_paid_prefix | Free shipping for orders over |
| free_ship_flag | Free shipping |
| cta1 | Order 1 piece — {price} |
| cta2 | Order 2 pieces — {price} |
| cta3 | Order 3 pieces — {price} |
| cart_pack_label | Pack of {qty} pieces |
| footer_badges | Shipping 1–3 days / Cash on delivery / Money-back guarantee (one per line) |
Package titles & notes
Each tier has its own title and note. Tier notes render the discount and savings automatically.
Placeholders
Placeholders are replaced with real values at render time:
{price} → discounted pack total (e.g. $28.80)
{save} → savings label + saved amount (e.g. savings $7.20)
{qty} → pieces in the pack (e.g. 2)
{unit_price}→ price per piece (e.g. $14.40)
{d2} → tier 2 discount (e.g. 40% or $7.20)
{d3} → tier 3 discount (e.g. 25% or $4.50)
Trust badges
The “badges below the button” textarea renders one badge per line with a ✓ icon — e.g. “Shipping 1–3 days”, “Cash on delivery”, “Money-back guarantee”.
7. Placement & Shortcodes
Where the buy box appears
- Automatic display — inserted on every simple, purchasable product page (hook
woocommerce_single_product_summary, priority 35) when automatic display is on. - Replace default “Add to cart” — removes the standard WooCommerce add-to-cart form so only the buy box is shown.
- Hide default product price — hides the standard price header (with a body class
drbu-hide-default-pricefor block themes). - Category & Shop popup — on shop, category and archive grids, clicking “Add to cart” opens the buy box in an interactive modal loaded via AJAX.
Product & category restrictions
- Product restriction: comma-separated product IDs, built with the built-in AJAX search (tag pills UI).
- Category restriction: checkbox list of all product categories.
- Storewide vs Target mode: with no restrictions the box appears on all simple products (Storewide); with any restriction it appears only on the selected products/categories (Target).
Shortcodes
| Shortcode | Description |
|---|---|
[tiered_buy_box] | Renders the buy box for the current product (single product page). |
[tiered_buy_box id="123"] | Renders the buy box for a specific product anywhere — pages, posts, landing pages. |
[order_now_5] | Legacy shortcode (backward compatible) with old attributes. |
[poruci_odmah_5] / [poruci_odmah_4] | Legacy Serbian shortcodes, same behavior. |
Legacy shortcode attributes
[order_now_5 id="123" discount2="40" discount3="25"
free_ship_threshold="50" best_label="Best value"
note1="Basic" note2="Popular" note3="Best deal" auto_discount="yes"]
discount2,discount3— override the 2nd/3rd tier discount.free_ship_threshold— override the free shipping threshold.best_label— override the best-value badge text.note1,note2,note3— override each tier note.auto_discount— enable/disable automatic discount calculation.
Frontend behavior
- The box renders only for simple, purchasable products with a price.
- Each product renders once per page — if the shortcode and auto-insert are both active, duplicates are prevented.
- The template file is
templates/tiered-buy-box.phpand can be overridden from the theme (see Developer Hooks).
8. Cart, Checkout & Order Meta
Buy box CTAs add the product to the cart with a pack parameter (?drbu_pack=N) and the pricing model (drbu_pm). DRBU_Cart_Handler then takes over.
Cart lifecycle
- Add to cart: pack data is attached to the cart item (
drbu_tier_index, discount type, pricing model, original price,drbu_d2,drbu_d3) and restored from the session on every request. - Price recalculation: before cart totals are calculated (
woocommerce_before_calculate_totals) the per-unit price is recomputed withDRBU_Pricing_Engineand line totals are set explicitly, so no theme or plugin can revert the regular price. - Cart display: under the product name the plugin shows the pack label (e.g. “Pack of 2 pieces”) and the savings amount (e.g. “savings $7.20”).
- Checkout & order: pack details are stored as order item meta for reporting and support.
Order meta written per item / order
| Meta key | Content |
|---|---|
_drbu_tier_index | Pack index chosen (1, 2 or 3) |
_drbu_tier_qty | Pieces in the pack |
_drbu_original_price | Base per-unit price before discount |
_drbu_pack_label | Rendered pack label (e.g. “Pack of 2 pieces”) |
_drbu_order_upsell | yes — flags the whole order as a DRBU upsell |
_drbu_max_tier_qty | Largest pack quantity in the order |
_drbu_tier_qty, drbu_tier_qty, _drbu_pack_label).9. Analytics & Reporting
WooCommerce → DRBU Analytics measures exactly how much incremental revenue the buy box generates. Only orders in completed, processing or on-hold status that contain DRBU packs are included. Periods: 7 days, 30 days, this month, all time (default 30 days).
Core metrics
| Metric | What it measures |
|---|---|
| Total Upsell Revenue | All revenue from DRBU orders in the period. |
| Total Orders Count | Number of DRBU orders in tracked statuses. |
| Average Order Value (AOV) | Total revenue ÷ total orders. |
| Total Customer Savings | Original total − paid total across all DRBU items. |
| Added Upsell Revenue | Incremental revenue vs. a single-item baseline for packs of 2+ pieces. |
| Upsell Conversion Rate | Share of DRBU orders that bought 2+ pieces. |
| Upsell Revenue Boost % | Added upsell revenue ÷ baseline single-item revenue. |
Breakdowns
- Sales by Pack Tiers — orders and revenue split into Pack 1, Pack 2, Pack 3 and Pack 3+ (any order over 3 pieces), with percentages and the most popular tier highlighted.
- Top Upsell Products — the 5 best performers, sorted by pack 2/3+ sales, with thumbnails, SKU, units, revenue and upsell revenue.
- Recent Upsell Orders — latest orders with number, date, customer, pack badge, status, origin (Checkout / Admin / DRBU Upsell / Web) and total, each linked to the order editor.
10. Free vs Pro
Licensing runs through Freemius (SDK initialized by drbu_fs()). The Free version is fully functional; the Pro version adds two features. drbu_is_pro_active() returns true when a Pro license is active or during the 30-day free trial (no payment details required).
| Feature | Free | Pro |
|---|---|---|
| Packaging tiers | Maximum 2 tiers (1 & 2 pieces) | Up to 3 tiers (1, 2 & 3 pieces) |
| Free shipping display | Off by default | On by default |
| Everything else | Identical: 4 pricing models, all styles, all texts, shortcodes, cart, analytics | |
11. Compatibility & Technical Notes
- WooCommerce HPOS: full compatibility declared for Custom Order Tables.
- Tested up to WooCommerce 9.5; requires PHP 8.0 and WordPress 6.4+.
- Architecture: clean object-oriented code — every module is a singleton (
DRBU_Core,DRBU_Settings,DRBU_Pricing_Engine,DRBU_Cart_Handler,DRBU_Shortcode,DRBU_Product_Display,DRBU_Analytics,DRBU_License). - Security: AJAX endpoints check a nonce (
drbu_admin_nonce) and themanage_woocommercecapability; all output is escaped/sanitized. - Assets: minified in production, unminified when
SCRIPT_DEBUGis on; frontend assets load only when needed (product, shop, category, archive, shortcode or category popup). - Multisite: WooCommerce detection includes network-activated plugins.
- Backward compatibility: legacy functions
drbu_calculate_unit_price()anddrbu_tier_total()still work, plus the legacyorder_now_5/poruci_odmah_5/poruci_odmah_4shortcodes.
12. Developer Hooks
For developers, see the full guide in Developer Docs. Summary of the extension points:
Filters
| Filter | Purpose |
|---|---|
drbu_is_pro_active | Override Pro detection (returns bool). |
drbu_enqueue_frontend_assets | Conditionally load or defer frontend assets. |
drbu_pack_discounts_enabled | Globally disable cart price recalculation. |
drbu_tier_total | Customize the final pack total after the pricing engine runs. |
drbu_license_is_valid / drbu_license_status | Integrate an external licensing add-on. |
Actions
| Action | Purpose |
|---|---|
drbu_license_init | Fires on init (priority 99) for licensing add-ons to hook into. |
Template override
templates/tiered-buy-box.php → your-theme/woocommerce/tiered-buy-box.php
Copy the template into the theme’s woocommerce/ folder to fully customize the markup. Theme overrides survive plugin updates.
Custom CSS
:root {
--drbu-primary: #2563eb; /* buttons & accents */
--drbu-cta-text: #ffffff; /* button text */
--drbu-best-value: #1d4ed8; /* best value badge */
--drbu-card-bg: #f8fafc; /* tier card background */
--drbu-btn-radius: 100px; /* button corner radius */
--drbu-card-radius: 16px; /* card corner radius */
}
13. Related Docs
🚀 Quick Start Guide
Install and configure the plugin in 4 steps.
🧮 Pricing Models
Deep dive into the 4 calculation models and margin strategy.
🎨 Appearance & Styles
Presets, colors and corner radiuses.
👁️ Display Options
Every buy box element, toggled.
🌐 Texts & Badges Translation
Language presets and all editable strings.
📄 Product Page Display & Integration
Automatic display, popups and restrictions.
🔗 Shortcodes
All shortcodes, attributes and placeholders.
📊 Analytics Dashboard
Metrics, revenue math and tier breakdowns.
🧩 Compatibility
HPOS and WooCommerce version support.
👨💻 Developer Docs
Filters, hooks, templates and CSS variables.
❓ FAQ
Common issues and troubleshooting.
📜 Changelog
Version history.