Setting up the export of product properties from 1C to 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
    1173
  • 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
    745
  • 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

Setting up product property export from 1C to 1C-Bitrix

Product properties (card requisites) are transmitted from 1C to Bitrix in the <СвойстваТовара> block of import.xml file. This is one of the most frequently requiring configuration parts of exchange: structure of data in 1C and Bitrix is different, and automatic matching doesn't always work correctly.

Structure of properties in CommerceML

In import.xml product properties look like:

<Товар>
  <Ид>GUID</Ид>
  <ЗначенияСвойств>
    <ЗначениеСвойства>
      <ИдСвойства>GUID-свойства</ИдСвойства>
      <Значение>Red</Значение>
    </ЗначениеСвойства>
  </ЗначенияСвойств>
</Товар>

Properties classifier (what the property is, data type, allowed values) is transmitted at beginning of import.xml in <Свойства> block. On first exchange Bitrix creates properties automatically — if they don't exist.

Properties mapping

In Bitrix admin: Catalog → 1C Exchange Settings → Property Matching. Here is defined, to which infoblock property each property from 1C goes.

Matching happens by property XML_ID in infoblock: when creating property automatically, field XML_ID is filled with property GUID from 1C. If property already exists — need to manually fill XML_ID in property settings.

For viewing and editing: Infoblocks → [needed infoblock] → Properties → XML_ID of each property.

Data types and their storage

Type in 1C Bitrix infoblock property Table
String "String" type b_iblock_element_prop_s{N}
Number "Number" type b_iblock_element_prop_s{N}
Boolean (Yes/No) "List" type (Y/N) or "Flag" b_iblock_element_prop_s{N}
Dictionary (value list) "List" type b_iblock_property_enum

Dictionaries (value lists) — separate story. In 1C stored as enumerations with GUID. In Bitrix — as b_iblock_property_enum with XML_ID. On first exchange Bitrix creates enumeration elements automatically. On subsequent — matches by XML_ID.

Multiple properties

If property in 1C can have multiple values (for example, "Applicability" — list of models, what spare part fits), in Bitrix create multiple property. In b_iblock_property field MULTIPLE = Y. Values stored in b_iblock_element_prop_m{N}.

When exchanging multiple <ЗначениеСвойства> tags with one <ИдСвойства> — Bitrix should process them as multiple value. If standard import doesn't — supplement via OnIBlockChange.

Post-processing via events

If standard mapping insufficient (for example, need to transform value — convert article to uppercase, supplement description), use event:

AddEventHandler('iblock', 'OnBeforeIBlockElementUpdate', function(&$arFields) {
    if ($arFields['IBLOCK_ID'] == CATALOG_IBLOCK_ID) {
        // Custom processing before saving
    }
});

SKU properties

SKU properties (color, size — those by which SKUs are formed) transmitted in offers.xml, not in import.xml. Their structure similar, mapping is configured for SKU infoblock separately.

What to check when setting up

  • Property XML_ID in infoblock matches GUID of property from 1C
  • Property type in Bitrix corresponds to data type from 1C
  • For dictionaries, enumeration elements have correct XML_ID
  • For multiple properties, flag MULTIPLE = Y is set