Configuring Unit of Measure Export from 1C to 1C-Bitrix
Units of measure are a technical detail that is often overlooked during integration. As long as everything is sold in pieces, this is invisible. But a building materials distributor sells one product in linear meters, another in square meters, and a third in rolls of 50 meters. Transferring this correctly to the site is a non-trivial task.
How Units of Measure Are Stored in 1C
In 1C:UT, units of measure are stored in the UnitClassifier directory (OKEI). Each unit has:
- OKEI code (796 = piece, 006 = meter, 055 = kg, etc.)
- Short name (pcs, m, kg)
- Full name
A nomenclature item can have multiple units of measure:
- Base unit — in which warehouse accounting is maintained
- Sales unit — in which the product is sold to the buyer (may differ)
- Additional units — with conversion coefficients
Example: cable is accounted for in meters (base), sold in coils of 100 meters (sales unit). The buyer orders "2 coils" → the warehouse receives a request for 200 meters.
Transferring Units of Measure in CommerceML
In CommerceML 2.08, the unit of measure is transferred in the BaseUnit tag:
<Product>
<Id>product-guid</Id>
<Name>Cable NYM 3x2.5</Name>
<BaseUnit OKEICode="006" FullName="Meter">m</BaseUnit>
</Product>
Bitrix saves the unit of measure in the MEASURE field of the infoblock element and in the b_catalog_measure table. When added to the cart, the unit is displayed next to the quantity.
Additional units — with coefficients — are transferred via UnitsOfMeasure:
<UnitsOfMeasure>
<UnitOfMeasure>
<Code>coil</Code>
<FullName>Coil</FullName>
<ShortName>coil</ShortName>
<Coefficient>100</Coefficient>
<PriceIncludesTax>false</PriceIncludesTax>
</UnitOfMeasure>
</UnitsOfMeasure>
The standard Bitrix exchange module supports this tag and creates units of measure in the trade catalog (b_catalog_unit) with conversion coefficients.
Configuring Quantity Multiples in Bitrix
For some products the minimum purchase quantity is a multiple of the unit of measure. A roll of wallpaper cannot be purchased as "half a roll." A box of nails — only in whole boxes.
In Bitrix this is configured via:
-
MEASURE_RATIO— multiple (e.g., 1 for pieces, 0.5 for weight-based products) - Quantity field in the cart with a step (the
stepattribute in the add form)
During exchange with 1C: if the nomenclature in UT has a packaging multiple — transfer it in AdditionalAttributes and handle it in the import handler:
if (isset($arXML['PACKAGE_RATIO'])) {
// Set the multiple in the trade catalog
CCatalogProduct::Update($elementId, [
'MEASURE_RATIO' => floatval($arXML['PACKAGE_RATIO']),
]);
}
Weight-Based Products
For a weight-based product (sold in kg with precision to 0.001), the cart needs an input field accepting non-integer values. Bitrix supports this via MEASURE_RATIO < 1 or via the STEP property in the trade catalog.
The price in this case is per base unit (per 1 kg). Total cost = price × entered quantity.
Building Materials: Multi-Unit Catalog
A building materials store is a classic example of complex units of measure:
| Product | Accounting Unit | Sales Unit | Coefficient |
|---|---|---|---|
| Laminate | m² | Pack (2.04 m²) | 2.04 |
| Cable | m | Coil (100 m) | 100 |
| Cement | kg | Bag (25 kg) | 25 |
| Profile | m | Bar (6 m) | 6 |
Each row is a separate unit of measure and multiple configuration in Bitrix. During exchange with 1C, all these coefficients must be transferred correctly.
Case Study: Wholesale Cable Products Store
A cable wholesaler: 4,000 items, all in meters. Sold in coils (coil length varies by cable type: 25, 50, 100, 200 m). On the site, the buyer selects the number of coils but sees the total length in meters.
Implementation:
- Base unit in 1C and Bitrix — meter
- Sales unit (from 1C) — coil with a coefficient (different for each item)
- In the product card: "Number of coils" field + "Total meters" field (auto-calculation via JS)
- In the cart: quantity stored in meters (base units), displayed in coils
The coil coefficient is transferred from 1C in UnitsOfMeasure. On update — automatically updated in Bitrix during the next nomenclature exchange.







