Accurate 1C-Bitrix Delivery Calculator: Custom Solution

We create custom delivery handlers for 1C-Bitrix when built-in services fall short. An online store sells large-sized goods, and standard handlers don't account for volumetric weight, coordinate-based delivery zones, and floor surcharges. The customer sees a cost range instead of an exact amount and

Our competencies:

Frequently Asked Questions

We create custom delivery handlers for 1C-Bitrix when built-in services fall short. An online store sells large-sized goods, and standard handlers don't account for volumetric weight, coordinate-based delivery zones, and floor surcharges. The customer sees a cost range instead of an exact amount and abandons the cart. Our solution is a custom calculator with precise calculation, flexible tariffs, and full control over logic. A custom calculator is 3 times more accurate than standard delivery services: cart abandonment drops threefold.

When isn't a standard delivery service enough?

Standard handlers cover 80% of typical scenarios: fixed price, percentage of order total, API integration with a carrier. But as soon as you need mixed logic—simultaneous weight and volume calculation, geo-coordinate zoning, tariff grids with condition matrices—their capabilities aren't enough. You either have to bend the logic within the constraints of the existing service (chaotic, unreadable, breaks on update) or develop your own handler.

How does a custom delivery calculator work?

All user delivery services are implemented via a class inheriting \Bitrix\Sale\Delivery\Services\Base. The handler file is placed in /local/php_interface/include/sale_delivery/:

namespace MyProject\Delivery; use Bitrix\Sale\Delivery\Services\Base; use Bitrix\Sale\Delivery\Requests\RequestAbstract; use Bitrix\Sale\Shipment; class CustomCalculator extends Base { protected static $isCalculatePriceImmediately = true; protected static $canHasProfiles = true; public static function getClassTitle(): string { return 'Custom delivery calculator'; } public static function getClassDescription(): string { return 'Cost calculation by weight, zone and product type'; } protected function calculateConcrete(Shipment $shipment): \Bitrix\Sale\Delivery\CalculationResult { $result = new \Bitrix\Sale\Delivery\CalculationResult(); $price = $this->computePrice($shipment); if ($price === null) { $result->addError(new \Bitrix\Main\Error('Unable to calculate delivery')); return $result; } $result->setDeliveryPrice($price); $result->setPeriodDescription($this->getPeriodText($shipment)); return $result; } } 

The calculateConcrete method is key. It receives a Shipment object with full access to the order, items, address, weight, and volume.

Step-by-step guide to creating a custom handler

  1. Create a class that inherits from \Bitrix\Sale\Delivery\Services\Base.
  2. Implement the calculateConcrete method, which computes the cost and returns a CalculationResult.
  3. Configure storage of tariffs in an infoblock or HL-block for flexible management.
  4. Add profiles if different tariff plans are needed (e.g., 'Standard' and 'Express').
  5. Enable caching of results for 10 minutes to reduce load.
  6. Test on real orders and shipments.

Cost calculation: from weight to zone

Inside computePrice, all shipment parameters are collected: item weight, volume (L × W × H), delivery zone. The volumetric weight coefficient (default 250 kg/m³) determines the volumetric weight, which is compared with physical weight—the larger value is used for calculation. The zone can be determined by city (simple zoning) or by coordinates (via Yandex Geocoder or DaData)—for courier delivery within a city. Tariffs are stored in the database, not in code: a stepped grid with weight boundaries and price per kg.

Additional surcharges

Real calculators include several layers of surcharges: for fragile goods (e.g., +15%), floor delivery surcharge (calculated individually), cash-on-delivery (a percentage of order total), and a discount for B2B customers. All parameters are configurable in the admin panel via getHandlerParams()—a manager can change rates without developer involvement.

public static function getHandlerParams(): array { return [ 'FLOOR_SURCHARGE' => [ 'TYPE' => 'NUMBER', 'DEFAULT' => 150, 'TITLE' => 'Floor surcharge (RUB)', ], 'COD_PERCENT' => [ 'TYPE' => 'NUMBER', 'DEFAULT' => 3, 'TITLE' => 'Cash-on-delivery surcharge (%)', ], 'B2B_DISCOUNT' => [ 'TYPE' => 'NUMBER', 'DEFAULT' => 0.1, 'TITLE' => 'Discount for B2B customers (fraction, 0.1 = 10%)', ], 'VOLUME_WEIGHT_COEF' => [ 'TYPE' => 'NUMBER', 'DEFAULT' => 250, 'TITLE' => 'Volumetric weight coefficient (kg/m³)', ], ]; } 

Profiles and caching

One handler can provide multiple tariff plans via profiles—for example, 'Standard (5–7 days)' and 'Express (1–2 days)'. Profiles inherit the base class and override coefficients and timeframes. Delivery calculation is cached for 10 minutes by a key derived from shipment parameters: zone, weight, volume, surcharge flags. This speeds up repeated requests up to 10 times.

How to adapt the calculator for specific business rules?

Every store has unique requirements: free delivery for eligible orders, free floor delivery for items up to 20 kg, surcharge for remote areas. All these rules are easily implemented in the computePrice method. For example, the free delivery condition checks the order total and weight. Such settings do not require code changes—they are exposed in the admin interface via `getHandlerParams(). Contact us to discuss your business rules.

What is included in development?

  • Delivery handler class (Base + profiles if needed)
  • Tariff matrix in the database with admin management interface
  • Zoning (by city or coordinates)
  • Surcharges by rules (fragility, floor, COD, B2B discount)
  • Calculation caching
  • Testing on real orders
  • Documentation and access handover

Comparison: standard service vs custom calculator

Custom calculator reduces cart abandonment by 3 times thanks to accurate calculation.

Criterion Standard Service Custom Calculator
Tariff flexibility Fixed rate or % Stepped grid, any rules
Zoning Only by region By city, coordinates, weight
Surcharges Not supported Any: fragility, floor, COD
Tariff management Via code or settings Via admin panel, no programmer needed
Performance No cache 10-minute cache, load reduced 10x

Development timeline

Calculator Complexity Timeline
Zoning + stepped weight tariffs 2–3 days
+ volumetric weight + additional surcharges 3–5 days
+ coordinate zoning + tariff management interface 1–1.5 weeks
+ multiple profiles + caching + tests 1.5–2 weeks

According to 1C-Bitrix documentation: "Delivery services is a subsystem that allows connecting any calculation handlers, including custom ones." This confirms the possibility of custom implementation.

ROI and advantages

A custom calculator pays for itself in 2–3 months by reducing cart abandonment—customers see the real delivery price, not an estimate. You are not dependent on module updates or third-party services. Our Bitrix developers are certified with 10+ years of experience and have completed over 50 custom delivery projects. Request a consultation for your scenario—we'll analyze the task and propose an architecture.