Setting up YML export in 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
    1175
  • 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
    747
  • 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 YML Export in 1C-Bitrix

YML (Yandex Market Language) — XML format that long outgrew Yandex.Market. Used by price aggregators (Goods Mail.ru, Price.ru), CRM systems for catalog import, affiliate networks for product feeds. In 1C-Bitrix, YML generation — standard function of catalog module, but default settings enough only for simplest catalogs.

Basic Export Profile Setup

Shop → Settings → Export catalog → Add profile → Yandex.Market (YML). Parameters:

  • Catalog infoblock — which infoblock to export from.
  • Price type — which price type goes to <price> tag. One selected.
  • Currency — RUR, USD, EUR. If catalog has prices in multiple currencies, feed price converted to selected currency.
  • Sections — can limit export to specific infoblock sections.
  • Export properties — which infoblock properties export as <param>.
  • Export file — path to result file, e.g., /upload/yml/feed.xml.

After saving — "Export" button. File generated and accessible by URL.

YML File Structure

Valid YML contains:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog date="2024-01-15 12:00">
  <shop>
    <name>Store Name</name>
    <company>Legal Entity</company>
    <url>https://site.ru</url>
    <currencies>
      <currency id="RUR" rate="1"/>
    </currencies>
    <categories>
      <category id="1">Electronics</category>
      <category id="2" parentId="1">Smartphones</category>
    </categories>
    <offers>
      <offer id="123" available="true">
        <url>https://site.ru/product/123/</url>
        <price>79990</price>
        <categoryId>2</categoryId>
        <picture>https://site.ru/upload/photo.jpg</picture>
        <name>Samsung Galaxy S24 Smartphone</name>
        <vendor>Samsung</vendor>
        <param name="Memory">256 GB</param>
      </offer>
    </offers>
  </shop>
</yml_catalog>

<categories> formed from infoblock sections. <offers> — from elements. Link via <categoryId> → section id.

What Standard Profile Does Wrong

1. Trade offers. If product has SKUs (infoblock trade offers), standard profile generates <offer> for each offer. But takes <name> from offer, not main product. Result: instead of "Nike Air Max Shoes" — "Nike Air Max Shoes — White, 42". For Yandex.Market normal, for price aggregator — no.

2. Multiple photos. Standard export takes DETAIL_PICTURE as main photo. Additional photos from multiple property (e.g., MORE_PHOTO) need explicit addition in profile settings. Each photo — separate <picture> tag.

3. Filtering. No filter "only products with inventory > 0". All active elements exported. To hide products without inventory — either deactivate them (breaks SEO), or modify profile.

4. Special characters. Characters &, <, > in description break XML. Standard profile escapes them, but if infoblock properties contain "raw" HTML — feed may become invalid. Check via xmllint or online YML validator.

Profile Modification

Handler file: /bitrix/modules/catalog/load/yandex_run.php. Don't edit directly — lost on update. Copy to /bitrix/php_interface/include/catalog_export/ under new name and register as custom profile.

Common modifications:

  • Inventory filter. Add to arFilter condition >CATALOG_QUANTITY => 0 or check via CCatalogStoreProduct for multi-warehouse.
  • Custom <name> format. Form title as "Brand + Model + Key property" instead of standard NAME.
  • <oldprice> for discounts. Standard profile doesn't export strikethrough price. Add <oldprice> tag, substitute value from another price type (e.g., "Retail before discount").
  • <delivery-options>. Tag for Yandex.Market with delivery conditions. Not generated by standard profile.
  • <sales_notes>. Note for buyer (minimum order amount, conditions). Up to 50 characters.

Automatic Generation

Cron task for periodic feed update:

*/30 * * * * /usr/bin/php /var/www/bitrix/modules/catalog/load/yandex_run.php PROFILE_ID

Or via Bitrix agent in profile settings — "Periodic export" option. Agent runs via cron_events.php. Interval — 30–60 minutes for most stores.

For catalogs 50,000+ products, YML generation can take 3–5 minutes. Ensure max_execution_time in PHP sufficient, or use step-by-step generation (split into N elements per iteration).

Task Time
Basic setup of standard profile 30 min
Custom profile with filtering and additional tags 3–5 h
Profile + cron + validity monitoring 1 day