Skip to content

Instantly share code, notes, and snippets.

@4e6ka
Last active March 12, 2024 11:26
Show Gist options
  • Save 4e6ka/22e2358a6872a788a8fbf2284a3a0c8d to your computer and use it in GitHub Desktop.
Save 4e6ka/22e2358a6872a788a8fbf2284a3a0c8d to your computer and use it in GitHub Desktop.
YML for Yandex ADS
<?xml version="1.0" encoding="UTF-8"?>
<yml_catalog date="[[!time2]]" >
<shop>
<name>[[++site_name]]</name>
<company>[[++site_name]]</company>
<url>[[!site_url]]</url>
<currencies>
<currency id="RUR" rate="1"/>
</currencies>
<categories>
<category id="50">pagetitle</category>
</categories>
<offers>
[[!msProducts?
&parents=`50`
&limit=`3000`
&resources=``
&depth=`4`
&where=`{"Data.price:>":1}`
&includeTVs=`model,shirina,img,dlina,check`
&includeContent=`1`
&tpl=`YML_offer_turbo`
&includeThumbs=`medium,medium_webp`
]]
</offers>
</shop>
</yml_catalog>
<offer id="[[+idx]]" available="true">
<name>[[+pagetitle]] [[+article]]</name>
<url>https://station-centre.ru/[[~[[+id]]]]</url>
<price from="true">[[!+price:replace=` ==`]]</price>
<vendor>vendor</vendor>
[[+old_price:gt=`[[+price:replace=` ==`]]`:then=`<oldprice>[[+old_price:replace=` ==`]]</oldprice>`:else=``]]
<currencyId>RUR</currencyId>
<available>true</available>
<sales_notes>delivery, other pros etc.</sales_notes>
<categoryId>[[+parent]]</categoryId>
<picture>[[!site_url]][[+image]]</picture>
<store>true</store>
<pickup>true</pickup>
<delivery>true</delivery>
<description>
<![CDATA[
[[+pagetitle]]. extra content
]]>
</description>
<param name="Артикул">[[+article]]</param>
[[+gabaritii:notempty=`<param name="Габариты" unit="мм">[[+gabaritii]]</param>`]]
<manufacturer_warranty>true</manufacturer_warranty>
<country_of_origin>[[+vendor.country]]</country_of_origin>
</offer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment