Custom Free Shipping Conditions in 1C-Bitrix
We develop custom free delivery conditions for 1C-Bitrix, overcoming the single-condition limitation of the standard restriction. When your business demands flexible rules—free only for promotional items, for new customers, by promo code, or with different thresholds per city—the built-in limits fall short. Our team of engineers with 10+ years of Bitrix experience has implemented 50+ projects with custom logistics. Let's walk through how to set up free delivery under non-standard conditions and what to watch out for to avoid breaking the cart.
Why Standard Bitrix Delivery Restrictions Aren't Enough
The default mechanism in Bitrix allows only one restriction: a minimum order amount for all customers. If you need differentiation by user groups, product types, or promocodes, you must write custom handlers. In real projects we have encountered 20+ condition variants not covered out of the box. Custom handlers are 3x more flexible than standard restrictions, enabling unlimited condition combinations. According to industry studies, 70% of e-commerce sites use free shipping as a marketing tool.
How to Set Up Free Delivery with the Standard Amount Restriction
-
In the admin panel, for each delivery handler go to "Restrictions" → "By order price" → set "Min order price" = 0, "Max" = empty. This enables the method for any amount.
-
For free delivery, create a separate handler instance (e.g., "CDEK Free") with zero price and a restriction based on a minimum order amount (configured in handler settings):
// Handler with fixed zero price class FreeDeliveryWrapper extends \Bitrix\Sale\Delivery\Services\Base { protected function calculateConcrete( \Bitrix\Sale\Shipment $shipment ): \Bitrix\Sale\Delivery\CalculationResult { $result = new \Bitrix\Sale\Delivery\CalculationResult(); $result->setDeliveryPrice(0); $result->setPeriodDescription('2–5 days'); return $result; } } The amount restriction is set via the standard UI. It's better to store the threshold in the handler's settings so you can change it without touching code. For more details on creating delivery handlers, see the documentation.
How to Implement Free Delivery for Specific Products Only
Scenario: delivery is free if the cart contains a product from the "Promo" section or a product with a certain property.
class ConditionalFreeDelivery extends \Bitrix\Sale\Delivery\Services\Base { public static function isCompatible(\Bitrix\Sale\Shipment $shipment): bool { $basket = $shipment->getOrder()->getBasket(); foreach ($basket as $item) { $productId = $item->getProductId(); // Check product property FREE_DELIVERY = Y $props = \CIBlockElement::GetProperty( $item->getField('MODULE'), $productId, [], ['CODE' => 'FREE_DELIVERY'] )->Fetch(); if ($props && $props['VALUE'] === 'Y') { return true; } } return false; } protected function calculateConcrete( \Bitrix\Sale\Shipment $shipment ): \Bitrix\Sale\Delivery\CalculationResult { $result = new \Bitrix\Sale\Delivery\CalculationResult(); $result->setDeliveryPrice(0); return $result; } } How to Set Up Free Delivery for New Customers
To offer free delivery only on first orders, use the OnSaleOrderSaved event and a flag on the order. In the handler restriction, check that flag. Algorithm: when an order is created, check the user's order history; if none, set a custom flag. In the delivery handler, check the flag and set price to zero.
How to Set Up Free Delivery by Promo Code
In the Bitrix basket, a promo code can be applied that affects delivery cost. Implement via a custom discount handler on delivery or through a cart property. The delivery handler must check for the coupon with a specific type and nullify the price.
Displaying Free Delivery Progress in Cart
Show in the cart: "Remaining for free delivery: [amount]". This is not a built-in Bitrix feature—implement it at the cart component template level.
// In the cart template $threshold = getFreeDeliveryThreshold(); // from handler settings $basketTotal = $APPLICATION->IncludeComponent('bitrix:sale.basket.basket', '', ['GET_BASKET_TOTAL' => 'Y'], false, ['HIDE_ICONS' => 'Y']); $currentTotal = $GLOBALS['BASKET_TOTAL'] ?? 0; $remaining = max($threshold - $currentTotal, 0); if ($remaining > 0) { echo 'До бесплатной доставки: ' . \CCurrencyLang::CurrencyFormat($remaining, 'CURRENCY'); } else { echo 'Доставка бесплатна!'; } It's better to retrieve $threshold from the delivery handler settings rather than hardcoding it in the template—so when the threshold changes, only one place needs updating.
Case Study from Our Practice
A sports nutrition store: free delivery with different minimum order thresholds for Moscow and regions. Standard Bitrix cannot handle this with a single handler—different thresholds for different zones. Solution: two instances of FreeDeliveryWrapper with different threshold settings and zone restrictions. Additionally, we set up a progress bar showing the remaining amount for free delivery, taking into account the customer's zone. This resulted in a 15% increase in average order value and a 20% reduction in abandoned carts.
What's Included in Free Delivery Setup
| Phase | Scope of Work |
|---|---|
| 1. Analysis | Audit current delivery scheme, identify non-standard conditions |
| 2. Design | Develop handler architecture, restrictions, integrations |
| 3. Development | Write custom classes, configure properties and restrictions |
| 4. Testing | Verify all scenarios: amount, products, zones, promocodes |
| 5. Documentation | Hand over documentation and train managers on delivery management |
Typical Mistakes in Setup
| Mistake | Consequence | How to Avoid |
|---|---|---|
| Hardcoding threshold in template | Must edit code when threshold changes | Store in handler settings |
| Not considering multiple zones | Clients from some regions see incorrect conditions | Create separate handlers with zone restrictions |
| Lack of testing with coupons | Promocodes don't nullify delivery | Check integration with cart and discounts |
We guarantee stable operation of the delivery scheme at all stages. Contact us for a consultation on your project. Our pricing for custom delivery handler development starts at $500 for basic conditions and ranges up to $2000 for complex multi-zone setups. Get an individual timeline and cost estimate by filling out the form on our website.
Timelines
| Configuration | Time |
|---|---|
| Standard amount restriction | 0.5 day |
| + Progress bar "Free delivery remaining" | +1 day |
| + Conditions by products or zones | +1–2 days |

