Setting up multi-warehouse functionality 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
    1177
  • 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 Multi-Warehouse Setup in 1C-Bitrix

When a store has multiple storage points — central warehouse, regional warehouses, retail points — and needs to show customer product availability at each or auto-select warehouse for shipment, single warehouse is insufficient. Multi-warehouse in Bitrix — part of catalog module, requires license not lower than "Small Business".

Enabling Multi-Warehouse

Shop → Catalog → Settings → "Warehouse" Tab:

  • Use warehouses — enable
  • Create minimum two warehouses (Shop → Catalog → Warehouses)

After enabling, stock stored in b_catalog_store_product partitioned by STORE_ID. Table contains: PRODUCT_ID, STORE_ID, AMOUNT (stock), QUANTITY_RESERVED.

Setting Up Shipment Warehouses in Orders

In delivery service settings (Shop → Settings → Delivery Services → [edit]) specify warehouse for shipment. This allows different services to work with different warehouses.

For more flexible control — warehouse selection rules configured via OnSaleOrderBeforeSaved event handler:

AddEventHandler('sale', 'OnSaleOrderBeforeSaved', function(\Bitrix\Main\Event $event) {
    $order = $event->getParameter('ENTITY');
    // logic for warehouse selection based on order composition, region etc.
});

Displaying Stock by Warehouses on Public Part

In catalog.element component (bitrix:catalog.element) parameter USE_STORE_QUANTITY — enable warehouse stock display. Component template receives $arResult['STORE_QUANTITY'] variable — array of stock by each warehouse.

For output use helper method:

$storeData = \Bitrix\Catalog\StoreProductTable::getList([
    'filter' => ['=PRODUCT_ID' => $productId],
    'select' => ['STORE_ID', 'AMOUNT', 'STORE_TITLE' => 'STORE.TITLE'],
    'runtime' => [
        new \Bitrix\Main\ORM\Fields\Relations\Reference(
            'STORE', \Bitrix\Catalog\StoreTable::class,
            \Bitrix\Main\ORM\Query\Join::on('this.STORE_ID', 'ref.ID')
        )
    ]
]);

Reservation in Multi-Warehouse

Reserves in b_sale_order_reserve contain STORE_ID field — reserve tied to specific warehouse. On auto-reservation Bitrix selects warehouse by priority (field SORT in b_catalog_store). If first warehouse lacks sufficient quantity — by default doesn't split order across warehouses: requires custom logic.

Stock Synchronization with 1C

On 1C exchange via CommerceML 2, stock transmitted in <Warehouses> section of exchange file. XML_ID of warehouses in Bitrix must match warehouse IDs in 1C. Warehouse mapping configured in /bitrix/admin/1c_exchange.php.

Execution Timeline

Setting multi-warehouse with two-three warehouses, shipment rules and display on site — 4–8 hours. Custom warehouse selection logic and 1C integration — 1–2 working days.