Developing quick order functionality by 1C-Bitrix article number

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

Quick Order by SKU Feature Development for 1C-Bitrix

On wholesale and B2B sites, buyers know the SKU — they do not want to search through a catalog. They need an input field: type the SKU, specify the quantity, add to cart. The standard 1C-Bitrix search (search.title) is not suitable for this: it searches by name, is slow on large catalogs, and does not support bulk input. Quick order by SKU is a separate UI block with direct database queries against an indexed field.

Product search by SKU

In 1C-Bitrix, the SKU is stored in an infoblock property (PROPERTY_ARTICLE) or in the element's XML_ID field. For trade offers — in the offer property (PROPERTY_CML2_ARTICLE when imported from 1C).

AJAX search controller:

public function searchByArticleAction(string $query): array
{
    $result = [];

    // Search among trade offers
    $offerIblockId = \CCatalogSKU::GetInfoByProductIBlock(CATALOG_IBLOCK_ID)['IBLOCK_ID'];

    $rs = \CIBlockElement::GetList(
        ['NAME' => 'ASC'],
        [
            'IBLOCK_ID' => $offerIblockId,
            'PROPERTY_CML2_ARTICLE' => '%' . $query . '%',
            'ACTIVE' => 'Y',
        ],
        false,
        ['nTopCount' => 10],
        ['ID', 'NAME', 'IBLOCK_ELEMENT_ID', 'PROPERTY_CML2_ARTICLE']
    );

    while ($item = $rs->Fetch()) {
        $result[] = [
            'sku_id'   => (int)$item['ID'],
            'product_id' => (int)$item['IBLOCK_ELEMENT_ID'],
            'article'  => $item['PROPERTY_CML2_ARTICLE_VALUE'],
            'name'     => $item['NAME'],
        ];
    }
    return $result;
}

For performance on catalogs with 50,000+ SKUs — add an index on the property column:

CREATE INDEX idx_iblock_prop_article
ON b_iblock_element_property (IBLOCK_PROPERTY_ID, VALUE)
WHERE VALUE IS NOT NULL;

Quick order interface

The block is a table with dynamic rows: each row has a SKU field with autocomplete, a quantity field, and a delete button. At the bottom is an "Add all to cart" button.

Autocomplete is implemented with a debounce(300ms) on the input field: when 3 or more characters are entered, an AJAX request fires to searchByArticleAction, and results are shown in a dropdown. When a product is selected, the row is populated with data showing a preview (thumbnail, name, current price).

Bulk input — an additional tab where a list can be pasted in the format:

SKU QUANTITY
ABC-123 5
XYZ-456 10

Parsed in JS, then a batch AJAX request resolves all SKUs at once.

Adding to cart

After confirmation — batch add to cart via \Bitrix\Sale\BasketItem:

$basket = \Bitrix\Sale\Basket::loadItemsForFUser(
    \Bitrix\Sale\Fuser::getId(), SITE_ID
);

foreach ($items as $item) {
    $basketItem = $basket->createItem('catalog', $item['product_id']);
    $basketItem->setFields([
        'QUANTITY' => $item['quantity'],
        'PRODUCT_PROVIDER_CLASS' => \Bitrix\Catalog\Product\Basket::class,
        'MODULE' => 'catalog',
    ]);
}
$basket->save();

When adding trade offers, the offer's PRODUCT_ID is passed with the link to the parent element via PROPS — this is required when using SKUs.

Error handling

  • SKU not found → row highlighted in red, tooltip "Product not found"
  • Product out of stock → warning with available quantity from b_catalog_store_product
  • Multiple matches for a SKU → dialog to select the correct SKU

What is included in development

  • AJAX controller for SKU search with trade offer support
  • UI block with dynamic rows, autocomplete, and product preview
  • Bulk input mode (paste a list of SKU + quantity)
  • Batch add to cart via \Bitrix\Sale\Basket
  • Error handling: not found, out of stock, multiple matches