Setting up cumulative discounts in 1C-Bitrix

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages

Configuring Cumulative Discounts in 1C-Bitrix

Cumulative discounts are a mechanism where the discount amount increases as the total purchase amount increases. In Bitrix, this is implemented through a combination of the sale module (order discounts) and user group logic: when a threshold is reached, the customer automatically moves to a group with a higher discount.

Principle of operation through user groups

The standard approach in Bitrix for cumulative discounts:

  1. Create several customer groups with increasing discounts: "Silver" (5%), "Gold" (10%), "Platinum" (15%)
  2. Assign one or more price groups to each customer group
  3. Configure automatic transfer of user to the next group when the order amount threshold is reached

Automatic transfer is not a built-in function, requires an OnSaleOrderSaved event handler:

AddEventHandler('sale', 'OnSaleOrderSaved', function(\Bitrix\Main\Event $event) {
    $order = $event->getParameter('ENTITY');
    $userId = $order->getUserId();

    // Calculate sum of paid orders by user
    $totalPaid = \Bitrix\Sale\Order::getList([
        'filter' => ['USER_ID' => $userId, 'PAYED' => 'Y'],
        'select' => ['PRICE'],
    ])->fetchAll();

    $total = array_sum(array_column($totalPaid, 'PRICE'));

    // Transfer to the appropriate group
    if ($total >= 50000) {
        CUser::SetUserGroup($userId, array_merge(CUser::GetUserGroup($userId), [PLATINUM_GROUP_ID]));
    } elseif ($total >= 20000) {
        CUser::SetUserGroup($userId, array_merge(CUser::GetUserGroup($userId), [GOLD_GROUP_ID]));
    }
});

Using order discounts with accumulator

An alternative to groups — order discounts from the sale module with a condition based on accumulated purchase amount. In Store → Discounts → Add discount:

  • Condition: "User's order amount" — built-in condition in discount constructor
  • Type: percentage discount
  • Groups: "All registered users"

Bitrix stores user order amount data in b_sale_user — field DISCOUNT_VALUE. It updates when the order status changes.

Configuring thresholds and notifications

To display customer progress to the next level in their personal account, a custom component is required that:

  • Reads current purchase amount from b_sale_user.DISCOUNT_VALUE
  • Calculates how much remains until the next threshold
  • Displays a progress bar

Estimated timeframes

Setting up cumulative discounts through user groups with automatic transfer — 4–8 hours. With a custom block in personal account — 1–2 business days.