Setting up a 1C-Bitrix product arrival notification

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

Stock Availability Notification Configuration in 1C-Bitrix

When a product runs out, instead of a "Buy" button you need to offer customers a subscription to stock notification. There's no built-in component for this in standard Bitrix — functionality is implemented via subscriptions module (subscribe) or custom table with stock change handler.

Option 1: Via Subscriptions Module

The subscribe module is designed for mailings, but can be adapted for product subscriptions. Customer subscribes to a "section" that corresponds to specific product (or SKU). When stock appears — manual or automatic sending.

Not the cleanest approach, but works without additional tables.

Option 2: Custom Subscriptions Table

More correct solution — separate table:

CREATE TABLE product_availability_notify (
    ID SERIAL PRIMARY KEY,
    PRODUCT_ID INT NOT NULL,
    EMAIL VARCHAR(255) NOT NULL,
    USER_ID INT NULL, -- NULL for guests
    DATE_ADD TIMESTAMP DEFAULT NOW(),
    DATE_SENT TIMESTAMP NULL,
    IS_SENT BOOLEAN DEFAULT FALSE,
    UNIQUE(PRODUCT_ID, EMAIL)
);

Subscription form — simple HTML form with AJAX submission, appears when QUANTITY = 0 on product page.

Notification Trigger on Stock Arrival

Sending when product arrives — via event handler for stock changes. Event is called when QUANTITY field in b_catalog_product is updated:

AddEventHandler('catalog', 'OnProductUpdate', function($productId, $fields) {
    if (isset($fields['QUANTITY']) && (float)$fields['QUANTITY'] > 0) {
        // Find subscribers and send notifications
        $subscribers = NotifyTable::getList([
            'filter' => ['=PRODUCT_ID' => $productId, '=IS_SENT' => false],
        ])->fetchAll();

        foreach ($subscribers as $subscriber) {
            \Bitrix\Main\Mail\Event::send([
                'EVENT_NAME' => 'PRODUCT_AVAILABLE_NOTIFY',
                'LID'        => SITE_ID,
                'C_FIELDS'   => [
                    'EMAIL'        => $subscriber['EMAIL'],
                    'PRODUCT_NAME' => $fields['NAME'],
                    'PRODUCT_URL'  => $fields['DETAIL_PAGE_URL'],
                ],
            ]);
        }
        // Mark as sent
        NotifyTable::updateMulti(['IS_SENT' => true], ['PRODUCT_ID' => $productId]);
    }
});

Email Template

Email event template is created in Settings → Email Events → Event Types. Event type PRODUCT_AVAILABLE_NOTIFY with fields EMAIL, PRODUCT_NAME, PRODUCT_URL.

Agent for Periodic Checks

Alternative to event — Bitrix agent, run on schedule (once per hour), that itself checks product stock appearance for products with subscribers:

Settings → Tools → Agents

Timeframe

Subscription form + handler + email — 4–8 hours. If subscription management page needed in personal account — additional 2–3 hours.