

Admin ruleset editor — create and configure a discount rule with type, conditions, and priority
RIACO Smart Quantity Discount is the easiest way to add powerful, flexible pricing promotions to your WooCommerce store. Whether you want to reward bulk buyers, run a Buy-One-Get-One campaign, or offer targeted discounts based on cart value or customer role, this plugin handles it all from a clean admin interface — no coding required.
Increase average order value. Tiered quantity discounts nudge customers to add one more item to unlock the next deal tier. Show the full pricing table right on the product page so shoppers always know the best price they can get.
Run BOGO promotions in minutes. Set up “Buy 2, Get 1 Free” (or any buy-X-get-Y ratio) and the plugin automatically adds the free product to the cart. When the qualifying item is removed, the free item disappears too — no manual cleanup needed.
Target the right customers. Apply rules only to specific products or categories, restrict them to certain user roles (e.g., wholesale members), or trigger them only when the cart reaches a minimum subtotal. Combine multiple conditions with AND/OR logic.
Non-destructive pricing. The plugin never overwrites WooCommerce’s own sale prices with a worse deal. If a product is already on sale, your rules only kick in when they give a better price — your existing promotions stay safe.
Priority-based rule stacking. Create as many rulesets as you need. Assign each one a priority number so you stay in full control of which rules are applied first. No unexpected conflicts, no surprises at checkout.
Works with block checkout. Fully compatible with the WooCommerce block cart and block checkout. BOGO free items show a “FREE” label, quantity fields are locked, and the remove button is hidden — giving customers a polished, confusion-free experience.
Discount types
Condition targeting
Rule management
Frontend display
Developer-friendly
__() with text domain riaco-smart-quantity-discountriaco_sqd_loaded
Fires after all plugin components are initialized. Use this to register integrations or extensions that depend on the plugin being ready.
riaco_sqd_before_apply_discounts( $cart )
Fires once per cart recalculation, before any ruleset is evaluated. Useful for pre-computation or logging.
riaco_sqd_after_apply_discounts( $cart, $discounted_cart_item_keys )
Fires after all rulesets have been evaluated. $discounted_cart_item_keys is an array keyed by cart item key; each value is ['price' => [...] | null, 'bogo' => [...] | null].
riaco_sqd_price_discount_applied( $cart_item_key, $regular_price, $plugin_price, $ruleset )
Fires whenever a simple or quantity price discount is applied to a cart item.
riaco_sqd_bogo_item_added( $added_cart_item_key, $parent_cart_item_key, $ruleset )
Fires when a new BOGO free item is added to the cart.
riaco_sqd_active_ruleset_ids( $ruleset_ids )
Modify the ordered array of ruleset IDs that will be evaluated. Return a filtered or reordered array.
riaco_sqd_item_qualifies_for_ruleset( $qualifies, $product_id, $cart_item_key, $ruleset )
Override whether a cart item qualifies for a given ruleset. Return true or false.
riaco_sqd_item_discounted_price( $plugin_price, $cart_item, $cart_item_key, $ruleset )
Adjust the final discounted price before it is set on the product. The engine clamps the return value to max(0, ...) after this filter, so a negative return is safe.
riaco_sqd_bogo_free_quantity( $desired_free_qty, $cart_item, $cart_item_key, $ruleset )
Cap or scale the number of free BOGO items added. Return value is cast to int and floored at 0.
riaco_sqd_condition_result( $condition_met, $type, $operator, $value, $product_id, $subtotal )
Override the boolean result of any individual condition check. Also the correct extension point for custom condition types — the built-in evaluation returns false for unknown types; hook here to handle them.
riaco_sqd_discount_types( $types )
Append custom discount type slugs to the allowed list (e.g. from a PRO add-on).
riaco_sqd_condition_types( $conditions )
Append custom condition type definitions to the admin conditions metabox.