Development of One-Click Order Module for 1C-Bitrix
One-click order is a path to purchase in one step: user enters only name and phone, manager handles the rest. Conversion with this scheme is higher than with full checkout, especially on mobile devices. Bitrix doesn't have a ready-made one-click order component — it's built on top of the standard sale module.
Where the Module Is Located
The module registers in local/modules/vendor.quickorder/. Key files:
-
lib/QuickOrderHandler.php— business logic for order creation -
lib/Notification.php— sending notifications -
components/vendor/quickorder.form/— form component -
install/db/install.sql— log table creation
Order Creation via Sale API
One-click order in Bitrix is implemented via the sale module API. A product is added to the cart programmatically, then an order is created:
use Bitrix\Sale\Order;
use Bitrix\Sale\Basket;
use Bitrix\Sale\BasketItem;
$order = Order::create(SITE_ID, null); // null = guest order
$order->setPersonTypeId(1);
$basket = Basket::create(SITE_ID);
$item = $basket->createItem('catalog', $productId);
$item->setFields([
'QUANTITY' => 1,
'CURRENCY' => \Bitrix\Currency\CurrencyManager::getBaseCurrency(),
'LID' => SITE_ID,
'PRODUCT_PROVIDER_CLASS' => \CCatalogProductProvider::class,
]);
$order->setBasket($basket);
$propertyCollection = $order->getPropertyCollection();
$propPhone = $propertyCollection->getPhone();
if ($propPhone) {
$propPhone->setValue($phone);
}
$order->setField('USER_DESCRIPTION', $comment);
$order->save();
The status of a new order is set to "New" (usually N) or to a special "One-Click Order" status, which is created separately in the sale module status dictionary.
Quick Order Log Table
Besides creating an order in the system, we write a log to a separate table b_quickorder_log — this allows building statistics without parsing the entire b_sale_order table:
| Field | Type | Purpose |
|---|---|---|
| ID | int auto_increment | — |
| ORDER_ID | int | Created order ID in b_sale_order |
| PRODUCT_ID | int | Product ID |
| PHONE | varchar(20) | Phone number |
| NAME | varchar(255) | Name |
| SOURCE_URL | varchar(2048) | Page from which order was placed |
| UTM_SOURCE | varchar(100) | UTM parameters |
| CREATED_AT | datetime | — |
| PROCESSED_AT | datetime | When manager took it |
Server-Side Validation
The one-click form is minimal — name and phone. Phone validation on server via regex accounting for formats: +7 (999) 123-45-67, 89991234567, +375 29 123-45-67. After normalization, store in E.164 format.
Flood protection: check in b_quickorder_log how many orders from this IP in the last hour. On exceeding threshold (e.g., 5 orders), return error without creating order.
Notifications
After successful order creation, two notifications fire:
For manager — email event QUICKORDER_NEW with template including customer name, phone, product name and photo, link to order in admin. Additionally, SMS can be configured via integrated SMS provider API.
For customer — optional SMS confirmation: "Your order is accepted, manager will contact you within 15 minutes".
CRM Integration
If the project has a CRM module (custom or Bitrix24), when creating a one-click order, a lead is automatically created. Data is passed via \Bitrix\Crm\LeadTable::add() or via Bitrix24 REST API (crm.lead.add). The lead SOURCE_ID field is set to "One-Click Order from Site".
Button on Product Card
The "Buy in 1 Click" button is placed in the bitrix:catalog.element component template. On click, it opens a modal with form — either via bitrix:sale.order.ajax with custom template, or via custom AJAX component. The modal should not reload the page and must work correctly when product card component caching is enabled (form is loaded via separate non-cacheable AJAX request).
Development Timeline
| Scale | Content | Duration |
|---|---|---|
| Basic | Form, order creation in sale, manager email notification |
3–4 days |
| Standard | + Flood protection, DB log, UTM parameters, SMS notification | 6–8 days |
| Extended | + CRM integration, source analytics, A/B form testing | 10–13 days |







