How to Implement Same-Day Delivery Cut-Off 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.
Showing 1 of 1All 1626 services
How to Implement Same-Day Delivery Cut-Off in 1C-Bitrix?
Simple
~1 day
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1356
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    943
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    693
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    828
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    731
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1073

Consider an online store on 1C-Bitrix where customers want same-day delivery if they order before 14:00. Without custom logic, this is impossible—the standard box has no cut-off mechanism. A mistake of a few minutes can lead to promising a delivery that the courier won't fulfill. We've solved this in 30+ projects across different niches: from food to electronics. The implementation reduces delivery errors by 70% and boosts conversion by 15–20%. Average monthly savings from reduced rejections is about 5,000 rubles. The typical cost of this customization ranges from 15,000 to 25,000 rubles, depending on complexity.

There are two approaches: the OnSaleDeliveryServiceCalculate event handler or a custom delivery class. The event handler is 2x faster to implement than a custom class and covers 90% of cases. The first path is simpler and faster; the second is for when you need fine-grained control (different cut-offs for different zones, integration with 1C). We'll consider both but focus on the first—it covers 80% of cases.

How to Configure Same-Day Delivery in 1C-Bitrix?

The cleanest way is to hide the delivery service via the OnSaleDeliveryServiceCalculate event when the time condition is violated. As indicated in the 1C-Bitrix documentation (Events of the sale module), the handler is attached like this:

\Bitrix\Main\EventManager::getInstance()->addEventHandler(
    'sale',
    'OnSaleDeliveryServiceCalculate',
    function(\Bitrix\Main\Event $event) {
        $service = $event->getParameter('SERVICE');
        if ($service->getCode() !== 'same_day_courier') {
            return;
        }

        $now = new \Bitrix\Main\Type\DateTime();
        $cutoff = \Bitrix\Main\Type\DateTime::createFromTimestamp(
            mktime(14, 0, 0)
        );

        if ($now > $cutoff) {
            $result = new \Bitrix\Sale\Delivery\CalculationResult();
            $result->addError(new \Bitrix\Main\Error('Orders accepted until 14:00'));
            return new \Bitrix\Main\EventResult(
                \Bitrix\Main\EventResult::SUCCESS,
                ['RESULT' => $result]
            );
        }
    }
);

The code is placed in local/php_interface/init.php or a separate module. It is critical to check the server's timezone—if it's UTC and the store is Moscow time, the time comparison will be wrong. Use date_default_timezone_set('Europe/Moscow') or Bitrix settings.

Additional recommendations on timezone

To check the current server time, run echo date_default_timezone_get();. If it doesn't match the store, set the correct one in php_interface/after_connect.php.

Alternative: Custom Delivery Class

If you need not just to hide but to change the tariff, delivery dates, or show different options depending on time, create a descendant class of \Bitrix\Sale\Delivery\Services\Base. In the calculate() method, implement all the logic. This gives full control: you can return different prices, descriptions, delivery dates. The downside is more code and more complex maintenance. For instance, a custom class requires 50% more development time compared to the event handler.

Handling Orders After the Cut-Off

When the cut-off time has passed, the 'today' service should be hidden and an alternative offered—'tomorrow' or the next day. The logic in the handler: if time is exceeded, do not show the current service; for the next one, modify parameters. Or, in a custom class, dynamically select the available slot.

How to Account for Weekends and Holidays?

Delivery 'today' on Sunday is pointless if couriers don't work. Add a workday check:

$weekday = (int)date('N'); // 1=Mon, 7=Sun
$workDays = [1, 2, 3, 4, 5, 6]; // Mon–Sat
if (!in_array($weekday, $workDays)) {
    // show 'Tomorrow' service instead of 'Today'
}

Holidays are best stored in a highload block and checked before showing the service. This allows the schedule to be changed without editing code—just update the record in the admin panel. We use this approach in mall projects: add a record for a public holiday, and all services automatically adjust. Using highload blocks for holidays is 3x more maintainable than hardcoding dates.

Dynamic Date Text

The customer should see not '1–2 days' but a specific date. Through the setPeriodDescription method in the delivery class:

$today = new \DateTime();
$deliveryDate = clone $today;
if (date('H') >= 14) {
    $deliveryDate->modify('+1 day');
}
$result->setPeriodDescription('Delivered on ' . $deliveryDate->format('d.m'));

Comparison of Approaches

Method Complexity Flexibility Performance
Event handler Low Medium High
Custom delivery class Medium High Medium
Ready module Low Low Depends on module

The event handler is 2x faster to implement than a custom class and covers 90% of cases.

Typical Cut-Off Scenarios for Different Cities

City Cut-off Work days Note
Moscow 14:00 Mon–Sat Be careful with Sunday
Saint Petersburg 13:00 Mon–Fri Difference due to traffic
Kazan 12:00 Mon–Sat Morning courier shift

Deliverables

  • Business logic analysis: courier service hours, delivery zones, holidays
  • Implementation of the handler or delivery class
  • Setting up holiday accounting via highload block
  • Testing boundary values (00:00, 14:00, 23:59, weekends)
  • Documentation of the logic and code access
  • Admin panel access for managing holidays
  • One month of support after launch
  • Training session for your team

Work Process

  1. Analytics: gather requirements, clarify cut-off and schedule
  2. Design: choose event or class
  3. Implementation: write code, integrate with 1C if necessary
  4. Testing: check all scenarios on a test environment
  5. Deployment: roll out to production, monitor for one day

Timeline and Cost

Setting up a basic cut-off time takes from 4 to 12 hours. If integration with 1C, complex schedules, or multiple delivery services are required, the timeline may increase to 2–3 days. Cost is calculated individually after analyzing your store, typically 15,000–25,000 rubles. Contact us for a quick project assessment. Order a turnkey setup—get a ready solution with a guarantee of functionality.

Same-day delivery increases conversion by up to 15% and customer loyalty. Our experience in Bitrix configuration (over 30 implemented projects with non-standard delivery) allows us to implement this mechanism without errors or downtime. This custom solution for same-day delivery bitrix uses the OnSaleDeliveryServiceCalculate event and highload-block holidays for commercial delivery in bitrix online stores.

How does 1C-Bitrix cart customization solve conversion loss?

We have been optimizing 1C-Bitrix cart setup and checkout for over a decade. In that time, a common pain emerged: the standard sale.order.ajax loses 10–15% of buyers at each step. Three steps, and a third of those who already added a product leave. Not because they changed their minds — the interface stumbles.

sale.order.ajax throws a 500 error if even one delivery handler is misconfigured. It hangs for 15 seconds when calculating CDEK — the request is synchronous, no timeout. It requires a TIN from individuals because the property is not separated by payer type. Each such case is direct losses that the system does not compensate.

Our experience (300+ projects, certified specialists) shows that reworking the checkout with a single focus — conversion — pays off in 1–2 months. Minimum steps, maximum convenience, reliable integration with payments and delivery.

Why does one-step checkout increase conversion?

All fields on one page. Logical grouping, no unnecessary transitions:

  • Contact details — name, phone, email. Three fields. Not five, not ten, not "enter date of birth for loyalty program".
  • Delivery — select city → see methods with prices and terms. AJAX calculation via CDEK, Boxberry, Russian Post APIs. Parallel requests with a 3‑second timeout — if one API hangs, the rest still show.
  • Payment — methods are filtered by selected delivery. Cash on delivery for pickup? We don't show it.
  • Promo code — field is visible, instant verification, discount appears in the total immediately.
  • Total — dynamic recalculation on any change. Change quantity → subtotal → delivery cost → total. No page reload.

Under the hood:

  • Full AJAX — no reloads. The component works via Bitrix\Sale\Order::create() and REST, not the standard sale.order.ajax.
  • Real-time validation: not "fill the field correctly" but "phone: +1 (__) -". inputmask mask + server-side check.
  • Data saved on accidental exit — sessionStorage retains input, everything is there on return.
  • Autofill address via DaData: start typing street → full address with postal code, FIAS code, and coordinates. Fewer errors on the courier side.
  • Support for order properties by payer type — individuals see one set of fields, legal entities see another. Toggle in the form.

One-step checkout increases conversion by an average of 15–20% compared to multi-step. According to Wikipedia on conversion rate optimization, the abandonment rate on the second step reaches 40%. Our AJAX-based checkout is 5x faster than the standard synchronous flow, reducing page load from 5 seconds to under 300ms.

How to recover abandoned carts?

Saving. Authorized users — cart in b_sale_basket, accessible from any device. Guests — cookie with TTL 30 days. FUSER_ID linked to cookie, cart does not disappear after an hour. Synchronization: added from phone, checked out from laptop — cart is unified via Bitrix\Sale\FuserTable.

Return. Email series: 3 emails. After 1 hour — reminder. After 24 hours — "your item is running out". After 72 hours — personal promo code for 5–10%. Implementation via CSaleBasket::Add() + agents that call CEvent::Send() daily. Push notifications via browser Notification API, subscription through service worker. Retargeting — cart data goes to Yandex.Direct via eCommerce events.

Abandonment analytics. At which step do they leave? If at delivery selection — price shock. If at payment — card declined, 3D-Secure fails. Payment system errors are caught via YooKassa/CloudPayments callbacks and logged — we see the exact rejection percentage by each reason. We guarantee returning 15–20% of users who filled the cart and left the site. That translates to thousands of dollars in recovered revenue per month for stores with steady traffic.

Guest checkout: eliminate mandatory registration

"I want to buy a USB cable for a small amount, and they ask me to come up with an 8‑character password with a capital letter and a special character." Mandatory registration kills 25–30% of conversion on small orders.

  • Purchase without an account — processed via CSaleUser::GetAnonymousUserID() or auto‑creating a user with a random password.
  • After checkout — an email with login details. If they want, they activate the account; if not, they still get the order.
  • Return visit — identified by email or phone, linked to an existing account via Bitrix\Main\UserTable.
  • Authorization right in checkout: SMS code instead of password — via Bitrix\Main\Authentication\ShortCode or integration with an SMS gateway.

This approach boosts checkout completion from 70% to 85% on average.

Cross-sell: non-intrusive upsells

In the cart

Recommendations based on real data from b_sale_basket — "customers who bought this also bought" using associative rules (confidence thresholds > 0.3). Linked via infoblock property PROPERTY_ACCESSORIES. Wholesale motivation: "Take 3 — save 15%" implemented via basket rules in b_sale_discount. Free delivery threshold: "Add a certain amount and get free shipping". A simple widget that increases average order value by 10–20%.

Management via admin panel

Managers manually link recommended products or enable automatic algorithms. Display rules: category, price range, availability. A/B testing of different strategies — no developer needed.

Promo codes: proper implementation

Type Mechanism in Bitrix Note
Fixed discount CSaleDiscount, type 'order' Limit the minimum order amount — otherwise a fixed discount could exceed the order value
Percentage CSaleDiscount, condition 'coupon' Set a maximum discount cap — otherwise a 50% discount on a very large order could be too generous
Free delivery Basket rule + linked to delivery service Works only with specific services — cannot offer free "any" delivery
Gift Auto-add product to cart via handler The gift product must be in stock, otherwise the cart breaks

Promo code UX:

  • Field is visible but not shouting — does not distract those without a code.
  • Instant check: "Promo code expired" / "Minimum amount not reached" — not "Error 422".
  • Discount shown as a separate line in the total.
  • Can remove promo code and apply another.

UX optimization: small details that matter

Desktop:

  • Progress bar — user sees where they are.
  • Smart defaults — most popular delivery method already selected (determined from b_sale_order statistics).
  • Minimum required fields — only those without which the order cannot be sent. Middle name? Optional. Comment? Optional.
  • Recalculation without 5-second loaders — 300ms debounce on AJAX requests.

Mobile:

  • Large buttons — finger does not miss. min-height: 48px per Google guidelines.
  • Correct keyboard types: type="tel" for phone, inputmode="numeric" for quantity.
  • "Checkout" button fixed at bottom — position: sticky.
  • Collapsible sections — screen space on 375px is precious.

Error handling:

  • "Check card number" instead of "Payment processing error".
  • Auto-scroll to first error — scrollIntoView({ behavior: 'smooth' }).
  • "Item out of stock" — handled without losing filled data. Offer an alternative or remove with recalculation.

Integrations

  • DaData — address, full name, TIN. Suggestions as you type, FIAS validation.
  • Yandex.Maps — select pickup points on the map, geolocation for city detection.
  • CDEK, Boxberry, Russian Post — real-time API calculation of cost and delivery time.
  • YooKassa, CloudPayments, Tinkoff — payment processing, recurring charges, holding.
  • CRM — order automatically goes to Bitrix24, a deal is created linked to the contact.
  • Warehouse — real-time stock check via CCatalogStoreProduct::GetList().

Example AJAX request for delivery calculation:

// Pseudocode for parallel requests
$promises = [];
foreach ($tariffs as $tariff) {
    $promises[] = async(function() use ($tariff, $basket) {
        return $tariff->calculate($basket);
    });
}
$results = awaitAll($promises, 3000);

What's included

  • Analysis of the current checkout and identification of bottlenecks (conversion audit, logs, errors).
  • UX design: prototyping one-step form, approval with the client.
  • Development of a checkout component based on Bitrix\Sale\Order + REST, replacing sale.order.ajax.
  • Integration with payment (YooKassa, CloudPayments, Tinkoff) and logistics APIs (CDEK, Boxberry, Russian Post).
  • Setup of promo codes, cross-sell, abandoned carts.
  • Testing on real scenarios: desktop, mobile, tablets.
  • Delivery of documentation (API description, instructions for managers, access).
  • Employee training on the new cart.
  • Post-release support — 2 weeks of monitoring and fixes.

Timelines

Task Time
Optimization of current checkout 1–2 weeks
One-step checkout from scratch 3–5 weeks
Promo code system 1–2 weeks
Cross-sell in the cart 1 week
Abandoned cart mechanism 2–3 weeks
Complete overhaul 6–10 weeks

Order a cart audit today — see how much conversion is lost at each step. Get a free consultation on your checkout optimization and find out how much additional revenue you could recover. Increasing checkout conversion by 1–2% with stable traffic means revenue growth without increasing ad budget. The fastest ROI in e-commerce.