Guest User

Ab market template

a guest
Aug 26th, 2020
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {** general **}
  2. <?xml version="1.0" encoding="UTF-8"?>
  3. <!DOCTYPE yml_catalog SYSTEM "shops.dtd">
  4. <yml_catalog date="{"Y-m-d H:i"|date}">
  5. <shop>
  6. <name>{$settings.Company.company_name}</name>
  7. <company>{$settings.Company.company_name}</company>
  8. <url>{$settings.Company.company_website}</url>
  9. {* Валюты *}
  10. {if !empty($currencies) and is_array($currencies)}
  11. <currencies>
  12. {foreach from=$currencies item='currency' key='currency_code'}
  13. <currency id="{$currency_code}" rate="{$currency.coefficient}"/>
  14. {/foreach}
  15. </currencies>
  16. {/if}
  17. {* Категории *}
  18. {if !empty($categories) and is_array($categories)}
  19. <categories>
  20. {foreach from=$categories item='category' key='category_id'}
  21. <category id="{$category_id}"{if $category.parent_id>0 && !empty($categories.{$category.parent_id})} parentId="{$category.parent_id}"{/if}>{$category.category}</category>
  22. {/foreach}
  23. </categories>
  24. {/if}
  25.  
  26. {* Товары *}
  27. <offers>
  28. {assign var="loaded" value=0}
  29. {assign var="step" value=1000}
  30. {assign var="params" value=['categories' => $categories, 'count_only' => true, 'get_images' => true, 'get_features' => true]}
  31. {assign var="total" value=fn__pfe_get_offers($datafeed, $params)}
  32. {$params.count_only = false}
  33. {while $loaded < $total}
  34. {math equation="min(step, (total - loaded))" loaded=$loaded total=$total step=$step assign="limit"}
  35. {$params.item_from = $loaded}
  36. {$params.items_per_page = $limit}
  37. {assign var="products" value=fn__pfe_get_offers($datafeed, $params)}
  38. {math equation="loaded + limit" loaded=$loaded limit=$limit assign="loaded"}
  39. {if $products}
  40. {foreach from=$products item='product'}
  41. <offer id="{$product.product_id}"{if $product.variation_group_id} group_id="{$product.variation_group_id}"{/if}>
  42. <url>{$product.url}</url>
  43. <price>{$product.price}</price>
  44. <currencyId>RUR</currencyId>
  45. <categoryId>{$product.category_id}</categoryId>
  46. {if !empty($product.images)}
  47. {foreach from=$product.images item="image_url"}
  48. <picture>{$image_url}</picture>
  49. {/foreach}
  50. {/if}
  51. <name>{$product.product}</name>
  52. <description><![CDATA[ {if $product.short_description}{$product.short_description nofilter}{else}{$product.full_description|strip_tags|truncate:320 nofilter}{/if} ]]></description>
  53. </offer>
  54. {/foreach}
  55. {/if}
  56. {/while}
  57. </offers>
  58. </shop>
  59. </yml_catalog>
RAW Paste Data