{$wa->globals(«isShopHome», true)}
{function name=»pluralform» n=1 f1=» f2=» f3=»}
{$n = abs($n)}
{$n1 = $n % 10}
{$n2 = $n % 100}
{$n}
{if $n1 == 1 && $n2 != 11}{$f1}
{elseif $n1 >= 2 && $n1 <= 4 && ($n2 < 10 || $n2 >= 20)}{$f2}
{else}{$f3}{/if}
{/function}
{strip}
{if $wa->photos}
{if $wa->isMobile()}
{$slider_photo = $wa->photos->photos($theme_settings.slider_photo_mobile)}
{else}
{$slider_photo = $wa->photos->photos($theme_settings.slider_photo)}
{/if}
{if $slider_photo}
{/if}
{/if}
{* Promo icons *}
{* Promo products *}
{if $theme_settings.homepage_productset_promo}
{$promos = $wa->shop->productSet( $theme_settings.homepage_productset_promo )}
{/if}
{if $promos && count($promos)}
{/if}
{* Popular categoires *}
{if $theme_settings.home_popular}
{if $categories_shop = $wa->shop->categories(0, null, true, true)}
{function popular_cat}
{foreach $items as $item}
{if in_array($item.id, $_c_shop)}

{else}
{if !empty($item.params.img)}

{else}

{/if}
{/if}
{if $theme_settings.home_popular_count}
{$productcount = $wa->shop->productsCount(«category/`$item.id`»)}
{if $productcount}
{if $wa->locale() == ‘ru_RU’}
{pluralform n=$productcount f1=’ товар’ f2=’ товара’ f3=’ товаров’}
{else}
{count($item.items)} [`products`]
{/if}
{/if}
{/if}
{/if}
{if !empty($item.childs)}
{popular_cat items=$item.childs}
{/if}
{/foreach}
{/function}
{popular_cat items=$categories_shop}
{/if}
{/if}
{* Bestsellers products *}
{if $theme_settings.homepage_productset_bestsellers}
{$bestsellers = $wa->shop->productSet( $theme_settings.homepage_productset_bestsellers )}
{/if}
{if $bestsellers && count($bestsellers)}
{if $theme_settings.top_product_timer != ‘off’}
{/if}
{/if}
{/if}
{* Brands logotypes *}
{if $wa->photos}
{$slider_brands = $wa->photos->photos($theme_settings.slider_brands)}
{if $slider_brands}
{/foreach}
{/if}
{/if}
{* Shop description *}
{if $wa->block(«main_block»)}
{if $wa->blog}
{$latest_posts = $wa->blog->posts(null, 2)}
{if $latest_posts}
{if !empty($post.img)}
{/if}
{/foreach}
{/if}
{/if}
{/if}
{* plugin hook: ‘frontend_homepage’ *}
{foreach $frontend_homepage as $_}{$_}{/foreach}
{/strip}