Configuring Cart Rules in 1C-Bitrix
Cart rules are an advanced mechanism that governs not only discounts but also cart behaviour: minimum/maximum order amounts, quantity limits for specific products, restrictions on adding competing items, and mandatory companion products. This is a layer built on top of the basic cart rules in the sale module, enabling business logic that standard discounts cannot handle.
Amount and Quantity Limits
Minimum order amount. Configured in site settings: Settings → Main Module Settings → Minimum Order Amount. This is a global setting. To enforce a minimum amount per user group or for a specific catalog section, a cart rule is required with a condition and the action "Prohibit order placement".
Event handler for programmatic enforcement:
AddEventHandler('sale', 'OnSaleComponentOrderOneStepProcess', function(&$arParams, &$arResult) {
$basket = $arResult['BASKET_ITEMS'];
$total = array_sum(array_column($basket, 'PRICE'));
if ($total < 1000) {
$arResult['ERROR_MESSAGE'] = 'Minimum order amount is 1000 roubles';
$arResult['ERROR'] = 'Y';
}
});
Per-customer quantity limit. A promotional product that cannot be purchased more than 2 units per order, or more than 5 units over all time. The second case requires a query against b_sale_basket or the user's order history — it can only be implemented through an event handler.
Rules for B2B Segments
In B2B stores, cart rules operate with user groups. Typical tasks:
- Wholesale thresholds: when quantity ≥ 10 units, the price drops to wholesale. Implemented via a cart rule with a quantity condition and the action "Discount on product" tied to a specific product code or section.
-
Supplier mixing restriction: only products from a single supplier may be in the cart. Adding a second supplier triggers a warning or auto-clear. Implemented via the
OnSaleBasketItemOnBeforeSetFieldhandler. - Mandatory minimum assortment: when placing an order, a distributor manager must include at least 3 SKUs from a category. Validation fires when attempting to proceed to checkout.
Companion and Mandatory Products
The rule "add a companion product" (e.g., a charger alongside a phone) works via the action "Add gift/companion product". The difference between a gift (price 0) and a companion product (full price) lies in the rule action.
Mandatory products — such as insurance when purchasing electronics — require custom logic. 1C-Bitrix has no built-in "mandatory product" mechanism in the cart. It is implemented through an event handler that blocks checkout when the required item is absent.
Testing Rules
After configuration, each rule must be verified across several scenarios: the rule applies when it should, does not apply when it should not, and is correctly removed when the cart changes. Pay special attention to rule combinations: two rules together must not produce unexpected results (e.g., a 110% discount).
Configuration Timeline
Configuring cart rules through the administrative interface takes half a day to 2 days depending on the number of rules and their complexity. Developing non-standard restrictions through event handlers takes 1–3 days, including testing all scenarios.







