Setting Up Bulk/Weight Products in 1C-Bitrix
Bulk products are sold in kilograms or grams, while the basket is designed for whole units. Customer wants 0.75 kg cheese, form only accepts whole numbers, order appears as "1 unit" instead of "750 g". This isn't an interface problem — it's a product configuration problem in the catalog.
Fractional quantity in basket
Bitrix supports fractional quantity via MEASURE field in b_catalog_product and STEP parameter in basket component. But by default, the quantity field in basket only validates whole numbers.
Key fields of b_catalog_product for bulk products:
-
MEASURE— ID of measurement unit fromb_catalog_measure(kg, g, l, etc.) -
QUANTITY_TRACE— whether to track inventory (Y/N) -
CAN_BUY_ZERO— sell at zero inventory
Measurement units are stored in b_catalog_measure: ID, SYMBOL_RUS (kg, g), SYMBOL_INTL (kg, g), CODE (numeric OKEI code).
Enabling fractional quantity for product:
\Bitrix\Catalog\ProductTable::update($productId, [
'MEASURE' => 6, // ID of "kg" measure from b_catalog_measure
'STEP' => '0.1', // quantity change step
]);
Basket component and quantity step
The bitrix:catalog.element component accepts PRODUCT_QUANTITY_STEP parameter. For bulk products, step is set in product's measurement units. If product is sold in 100 gram increments and measure is kilograms, step equals 0.1.
In basket component template (bitrix:sale.basket.basket), quantity input field should be changed from type="number" step="1" to step="0.001" and remove pattern attribute if it limits input to whole numbers. This is done in template /bitrix/templates/[template]/components/bitrix/sale.basket.basket/[basket_template]/.
Server-side quantity validation — method \Bitrix\Sale\BasketItem::setField('QUANTITY', $qty). Bitrix doesn't limit quantity to whole number at ORM level, but add-to-basket component bitrix:catalog.element might round the passed value if its code contains intval() — this needs to be checked in the component template.
Shipping calculation by weight
With bulk products, shipping cost is calculated by total order weight. Product weight is stored in b_catalog_product — field WEIGHT in grams. When added to basket, weight is copied to b_sale_basket — field WEIGHT.
Shipping calculation via \Bitrix\Sale\Delivery\Services\Manager uses weight from basket. Problem occurs when WEIGHT in b_catalog_product is set for whole unit (1 kg = 1000 g), but customer adds 0.75 kg. In this case, weight in basket should be 750 g, but Bitrix by default takes WEIGHT as is and multiplies by quantity: 1000 * 0.75 = 750 — this works correctly if weight is set as weight per measurement unit.
Verification: if product measure is grams and WEIGHT is also grams (for one gram = 1), then for 750 g weight = 1 * 750 = 750 g — correct. If measure is kilograms and WEIGHT = 1000 g per kg, then 0.75 kg gives 750 g — also correct.
Barcodes for bulk products
Bulk products in retail often use EAN-13 with weight in barcode (PLU format: prefix 2 + product code + weight). Bitrix doesn't decode PLU barcodes out of the box. For POS integration you need a handler that when barcode is scanned:
- Determines prefix
2— bulk product. - Extracts product code (positions 3-7 in EAN-13 PLU standard).
- Extracts weight from positions 8-12 (in grams, divided by 1000).
- Finds product by code in
b_catalog_product_barcode. - Adds to basket with calculated quantity.
This handler is implemented as OnSaleBasketItemAdd event handler or as separate AJAX endpoint for POS software.
Inventory for bulk products
QUANTITY in b_catalog_product for bulk products is stored in product's measurement units. If measure is kilograms, inventory 5.750 means 5 kg 750 g. Synchronization with 1C should transmit inventory in the same unit — this must be explicitly agreed when setting up the exchange.







