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.







