Configuring Barcode Export from 1C to 1C-Bitrix
Barcodes on a site are not merely cosmetic additions to the product card. They are the key to fast search (a buyer scans the packaging), integration with marketplaces (EAN is required), and automatic identification systems in B2B. In 1C, barcodes are stored in a separate register, and transferring them to Bitrix is a separate task not covered by standard CommerceML out of the box.
How Barcodes Are Stored in 1C
In 1C:UT 11 and other configurations, barcodes are stored in the information register ProductBarcodes. Structure:
- Nomenclature — reference to the directory
- Characteristic — if the barcode is linked to a specific characteristic (SKU)
- Unit of measure — EAN for piece, box, pallet may differ
- Barcode — string (EAN-8, EAN-13, Code128, QR, Datamatrix)
- Barcode type — EAN13, EAN8, Code128, etc.
One product can have multiple barcodes:
- EAN-13 for a unit (piece)
- EAN-13 for a package (6 pieces)
- Code128 for a pallet
- Additional supplier barcode
CommerceML and Barcodes: Standard Method
CommerceML 2.08 has a Barcode tag — but its support in the standard Bitrix exchange module is limited. The barcode is transferred as an additional attribute or via a special tag inside <Product>:
<Product>
<Id>product-guid</Id>
<Name>Sample Product</Name>
<Barcode>4607025491117</Barcode>
</Product>
Some versions of the Bitrix exchange module read this tag and write it to the infoblock property CML2_BAR_CODE. Check: if the CML2_BAR_CODE property exists after the first import — the barcode is being transferred in the standard way.
If not — an import event handler is needed.
Custom Handler for Multiple Barcodes
For transferring multiple barcodes (per unit of measure), the standard tag is insufficient. Use AdditionalAttributes:
<AdditionalAttributes>
<AttributeValue>
<Name>BarcodePiece</Name>
<Value>4607025491117</Value>
</AttributeValue>
<AttributeValue>
<Name>BarcodeBox</Name>
<Value>4607025491124</Value>
</AttributeValue>
</AdditionalAttributes>
In Bitrix, create infoblock properties BARCODE_UNIT and BARCODE_BOX of type "String". The OnIBlockCMLImport2ElementAdd event handler populates these properties:
AddEventHandler('catalog', 'OnIBlockCMLImport2ElementAdd',
'fillBarcodeProperties');
function fillBarcodeProperties(&$arFields, &$arProps, $arXML) {
if (isset($arXML['BARCODE_UNIT'])) {
$arProps['BARCODE_UNIT'] = $arXML['BARCODE_UNIT'];
}
if (isset($arXML['BARCODE_BOX'])) {
$arProps['BARCODE_BOX'] = $arXML['BARCODE_BOX'];
}
}
Barcodes for Trade Offers (SKUs)
If a barcode is linked to a characteristic (e.g., different EANs for a red and blue T-shirt), it must be transferred at the offer level, not the product level. In the offer XML:
<Offer>
<Id>product-guid#characteristic-guid</Id>
<Barcode>4607025491131</Barcode>
</Offer>
In the Bitrix offer infoblock, create a BARCODE property and populate it using a similar handler, but for the OnIBlockCMLImport2OfferAdd event.
Barcode Search on the Site
After populating the BARCODE property, barcode search is implemented via the standard Bitrix search component or custom code:
$result = CIBlockElement::GetList(
[],
[
'IBLOCK_ID' => CATALOG_IBLOCK_ID,
'PROPERTY_BARCODE' => $scannedCode,
],
false,
false,
['ID', 'NAME', 'DETAIL_PAGE_URL']
);
For mobile sites — integrate a barcode scanning library via camera (ZXing or QuaggaJS). The user scans the package barcode — the site instantly opens the product card.
Case Study: B2B Platform with EDI
A food manufacturer with EDI integration: retailers require EAN-13 on every item in the price list. Barcodes are maintained in 1C, but historically were not exported to the B2B portal.
Task: add EAN-13 to every item in the B2B portal catalog so that retailers can copy them when loading into their own systems.
A one-time export of all barcodes from 1C was performed (external processing → CSV), then loaded into Bitrix via a mass update script for the BARCODE property. Time: 4 hours for 12,000 items.
Subsequent synchronization during exchange was configured: new products arrive with a barcode in AdditionalAttributes, the handler populates the property. Changes to an existing item's barcode — via the same mechanism.







