Configuring Order Consolidation from Different Warehouses 1С-Bitrix
Customer ordered three products: one is in warehouse A, another in warehouse B, third needs to come from remote warehouse C. Task — either wait for complete order assembly and ship as one package, or ship in parts. Bitrix doesn't manage this automatically — consolidation logic builds on top standard multi-warehouse system.
Multi-warehouse in Bitrix
Warehouses stored in b_catalog_store, inventory in b_catalog_store_product. Reservation on order works via b_sale_reserve_quantity. On checkout Bitrix doesn't automatically select warehouse — done manually or via custom logic.
To determine which warehouse to ship each product from, use \Bitrix\Catalog\StoreProductTable::getList() with filter by PRODUCT_ID and condition AMOUNT > 0.
Consolidation strategies
Strategy 1: Maximum speed — each product shipped from nearest warehouse immediately when available. Customer receives several packages. Implementation: on order creation agent immediately splits it into sub-orders by warehouse.
Strategy 2: Minimum packages — wait for complete order assembly on one "main" warehouse, to which needed items are moved. Implementation: inter-warehouse movement via b_catalog_store_document with type M.
Strategy 3: Hybrid — in-stock items shipped immediately, back-ordered items waited.
Order split into sub-orders
Create bl_order_shipments table with fields order_id, store_id, status, items_json. On order confirmation agent analyzes basket:
foreach ($basket as $item) {
$stores = StoreProductTable::getList([
'filter' => ['PRODUCT_ID' => $item->getProductId(), '>AMOUNT' => 0],
'order' => ['AMOUNT' => 'DESC'],
])->fetchAll();
$bestStore = $stores[0]['STORE_ID'] ?? $defaultStoreId;
$shipments[$bestStore][] = [
'product_id' => $item->getProductId(),
'quantity' => $item->getQuantity(),
];
}
Each group recorded in bl_order_shipments. Sub-order statuses tracked independently.
Customer display
In personal account and order letter show breakdown: "Package 1 (Moscow warehouse): 2 items — shipped", "Package 2 (SPb warehouse): 1 item — in transit". Personal account component gets data from bl_order_shipments and combines with main order by order_id.
What we configure
- Table
bl_order_shipmentsfor storing sub-order information by warehouse - Agent analyzing availability and distributing items by warehouse
- Consolidation strategy (configured in
b_option) - Updating sub-order statuses on warehouse document changes
- Displaying sub-orders in customer personal account and admin interface







