Setting up a notification about order readiness for delivery 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
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • 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
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Configuring Order Ready for Pickup Notifications in 1C-Bitrix

An order is assembled at the warehouse, but the customer doesn't know. They arrive too early — the item isn't ready yet. Or too late — the manager has already released the reservation. The "Your order is ready for pickup" notification must be sent at the exact moment a warehouse employee changes the order status, via SMS, Telegram, or email.

Order Status as a Trigger

1C-Bitrix has no dedicated "Ready for Pickup" status out of the box. Create a custom status:

Store → Settings → Order Statuses → Add:

  • Symbolic code: RC (Ready for Collect)
  • Name: "Ready for Pickup"
  • Color: green

After creating the status — attach a handler for status changes:

\Bitrix\Main\EventManager::getInstance()->addEventHandler(
    'sale',
    'OnSaleOrderStatusChange',
    function (\Bitrix\Main\Event $event) {
        $order    = $event->getParameter('ENTITY');
        $newStatus = $order->getField('STATUS_ID');

        if ($newStatus !== 'RC') {
            return; // We only care about the "Ready for Pickup" status
        }

        // Get the pickup location from the order property
        $pickupStoreProp = $order->getPropertyCollection()
            ->getItemByOrderPropertyCode('PICKUP_STORE_ID');
        $storeId = $pickupStoreProp ? $pickupStoreProp->getValue() : null;

        $storeInfo = null;
        if ($storeId) {
            $storeInfo = \Bitrix\Catalog\StoreTable::getById($storeId)->fetch();
        }

        // Build and send the notification
        \Local\Notifications\ReadyForPickupNotifier::notify($order, $storeInfo);
    }
);

Readiness Notification Class

// /local/lib/Notifications/ReadyForPickupNotifier.php
namespace Local\Notifications;

use Bitrix\Sale\Order;

class ReadyForPickupNotifier
{
    public static function notify(Order $order, ?array $storeInfo): void
    {
        $userId = $order->getUserId();
        $user   = \Bitrix\Main\UserTable::getById($userId)->fetch();

        $storeName    = $storeInfo['TITLE'] ?? 'the store';
        $storeAddress = $storeInfo['ADDRESS'] ?? '';
        $orderId      = $order->getId();

        // Storage period — from settings (default 5 days)
        $holdDays = (int)\Bitrix\Main\Config\Option::get(
            'local.pickup', 'hold_days', 5
        );
        $holdUntil = date('d.m.Y', strtotime("+{$holdDays} days"));

        $message = "Order #{$orderId} is ready for pickup at {$storeName}.\n";
        if ($storeAddress) {
            $message .= "Address: {$storeAddress}\n";
        }
        $message .= "Held until: {$holdUntil}.";

        // Telegram
        if (!empty($user['UF_TELEGRAM_CHAT_ID'])) {
            \Local\Telegram\BotService::sendMessage(
                $user['UF_TELEGRAM_CHAT_ID'],
                $message
            );
        }

        // SMS via service
        $phone = $order->getPropertyCollection()
            ->getPhone()
            ?->getValue();
        if ($phone) {
            \Local\Sms\SmsService::send($phone, $message);
        }

        // Email — standard 1C-Bitrix mechanism
        // Create an event for the email template
        \CEvent::Send('ORDER_READY_FOR_PICKUP', SITE_ID, [
            'ORDER_ID'      => $orderId,
            'STORE_NAME'    => $storeName,
            'STORE_ADDRESS' => $storeAddress,
            'HOLD_UNTIL'    => $holdUntil,
            'USER_EMAIL'    => $user['EMAIL'],
            'USER_NAME'     => $user['NAME'],
        ]);
    }
}

The email notification template is created in Settings → Mail Events → Templates → Add with event type ORDER_READY_FOR_PICKUP.

Automatic Transition on Stock Arrival

For Click & Collect with reservation — when an out-of-stock item arrives at the pickup point's warehouse, the order should automatically transition to "Ready for Pickup":

\Bitrix\Main\EventManager::getInstance()->addEventHandler(
    'catalog',
    'OnProductUpdate',
    function (\Bitrix\Main\Event $event) {
        $productId = $event->getParameter('ID');
        $fields    = $event->getParameter('FIELDS');

        if (!isset($fields['QUANTITY']) || $fields['QUANTITY'] <= 0) {
            return;
        }

        // Find pending orders for this product with pickup delivery
        $waitingOrders = \Local\Orders\PickupOrderFinder::getWaiting($productId);
        foreach ($waitingOrders as $waitingOrderId) {
            $order = \Bitrix\Sale\Order::load($waitingOrderId);
            if ($order && $order->getField('STATUS_ID') === 'N') {
                $order->setField('STATUS_ID', 'RC');
                $order->save();
            }
        }
    }
);

Implementation Timeline

Custom "Ready for Pickup" status, event handler, multi-channel notification (Telegram + SMS + email template) — 4–8 hours. Plus automatic transition on stock arrival — an additional 4–6 hours.