Supplier catalogs

How to keep YML offers with vendorCode in the needed format

2026-06-29
Task

The YML contains normal SKUs and free text in vendorCode. The import needs only codes such as LA-22001.

Short answer

Add an export condition to offer: vendorCode must match regular expression ^[A-Z]{2}-[0-9]{5}$ (matches two uppercase Latin letters, a dash, and five digits from start to end).

How to do it in Eofferix

  1. In the XML/YML snapshot, select the repeated offer node.

  2. Open the node settings.

    Opening offer settings
    The animation shows opening settings for the repeated product node.
  3. Add an export condition for vendorCode: vendorCode ^[A-Z]{2}-[0-9]{5}$.

    Export condition
    The condition is applied to the whole item.

Before / after

Before

source data
<yml_catalog date="2026-06-29 10:00">
  <shop>
    <offers>
      <offer id="YML-22001"><name>Hudson lamp</name><vendorCode>LA-22001</vendorCode><price>1290.00</price></offer>
      <offer id="YML-22002"><name>Parker chair</name><vendorCode>supplier item 22002</vendorCode><price>8400.00</price></offer>
      <offer id="YML-22003"><name>Harbor shelf</name><vendorCode>PN-22003</vendorCode><price>990.00</price></offer>
    </offers>
  </shop>
</yml_catalog>

After

result
<yml_catalog date="2026-06-29 10:00">
  <shop>
    <offers>
      <offer id="YML-22001"><name>Hudson lamp</name><vendorCode>LA-22001</vendorCode><price>1290.00</price></offer>
      <offer id="YML-22003"><name>Harbor shelf</name><vendorCode>PN-22003</vendorCode><price>990.00</price></offer>
    </offers>
  </shop>
</yml_catalog>

What to keep in mind

  • If one prefix is enough, for example LA-, use contains or starts with without a regular expression.
  • Put the mask on offer so the whole product with a bad SKU is removed.

Process data faster with Eofferix

Create a free account to automate catalogs and price lists around your own rules.

Sign up