Создаем ресурс, Тип содержимого — XML, помещаем туда следущее:
<?xml version="1.0" encoding="UTF-8"?>
<yml_catalog date="[[!simple_time]]" >
<shop>
<name>[[++site_name]]</name>
<company>[[++site_name]]</company>
<url>[[++site_url]]</url>
<currencies>
<currency id="RUR" rate="1"/>
</currencies>
<categories>
[[pdoResources? &parents=`0` &depth=`10` &limit=`10000` &tpl=`yml_categories` &where=`{"class_key":"msCategory"}` &showUnpublished=`1`]]
</categories>
<offers>
[[msProducts? &templates=`5` &depth=`10` &limit=`10000` &parents=`2` &tpl=`yml_offer` &includeTVs=`image,model,brend` [[-&includeContent=`1`]]]]
</offers>
</shop>
</yml_catalog>
Чанк yml_categories
<category id="[[+id]]" [[+parent:isnot=`2`:then=`parentId="[[+parent]]"`]]>[[+pagetitle]]</category> [[-Тут важно поменять id parent. Укажите там id корневого ресурса каталога]]
Чанк yml_offer
<offer id="[[+id]]" available="true">
<url>[[~[[+id]]? &scheme=`full`]]</url>
<price>[[+price:stripString=` `]]</price>
[[+old_price:isnot=`0`:then=`<oldprice>[[+old_price:stripString=` `]]</oldprice>`]]
<currencyId>RUR</currencyId>
<categoryId>[[+parent]]</categoryId>
<delivery-options>
<option cost="300" days="2-5"/>
</delivery-options>
[[-<typePrefix>[[#[[+parent]].pagetitle:htmlent]]</typePrefix>]]
<vendor>[[+brend:htmlent]]</vendor>
<model>[[+model:htmlent]]</model>
<description>[[+introtext:htmlent]]</description>
<vendorCode>[[+article]]</vendorCode>
[[-<local_delivery_cost>0</local_delivery_cost>]]
<manufacturer_warranty>true</manufacturer_warranty>
<picture>http://ваш сайт без слэша[[+thumb]]</picture>
<name>[[+pagetitle:htmlent]]</name>
[[!print_props?&tpl=`print_props_tpl`&res_id=`[[+id]]`]]
</offer>
Сниппет print_props
Речь идет об опциях, котрые храняться в таблицах modx_ms2_product_options, modx_ms2_options. Подробнее об этом сниппете читайте тут.
Сниппет simple_time
return date("Y-m-d H:i");
Из-за чего это может быть?