{* supreme 1.7.3 *} {* variables: showtoolbar show_sort show_per_page=0 catalog_view per_row compact shuffle *} {* Toolbar *} {if isset($showtoolbar) && $showtoolbar == 1} {$catalog_view = waRequest::cookie('catalog_view')} {if !$catalog_view} {if isset($theme_settings.catalog_default_view)} {$catalog_view = $theme_settings.catalog_default_view} {else} {$catalog_view = 'grid'} {/if} {/if} {include file="`$wa_active_theme_path`/products.toolbar.html" inline} {else} {if !isset($catalog_view)} {$catalog_view = 'grid'} {/if} {/if} {$favList = waRequest::cookie('shop_favorites')} {$favList = ","|explode:$favList} {$skus = $wa->shop->skus(array_keys($products))} {$images = $wa->shop->images(array_keys($products))} {* Availability status *} {$availability = [ 'yes' => "[`In stock`]", "no" => "[`Out of stock`]", "preorder" => "[`Pre-order only`]", "unavailable" => "[`Unavailable`]" ]} {if $catalog_view == 'grid' || $catalog_view == 'slider'} {if isset($per_row)} {$per_row = $per_row} {elseif isset($theme_settings.catalog_products_per_row)} {$per_row = $theme_settings.catalog_products_per_row} {else} {$per_row = 4} {/if} {if isset($theme_settings.catalog_larger_images) && $theme_settings.catalog_larger_images} {$larger_images = "larger_images"} {else} {$larger_images = ""} {/if} {if $catalog_view == 'grid'} {if isset($compact) && $compact == true} {$compact = true} {else} {if isset($theme_settings.catalog_grid_compact) && $theme_settings.catalog_grid_compact} {$compact = true} {else} {$compact = false} {/if} {/if} {else if $catalog_view == 'slider'} {if isset($compact) && $compact == true} {$compact = true} {else} {if isset($theme_settings.slider_grid_compact) && $theme_settings.slider_grid_compact} {$compact = true} {else} {$compact = false} {/if} {/if} {/if} {if $compact} {$grid_compact_class = 'grid_compact'} {else} {$grid_compact_class = ''} {/if} {if $catalog_view == 'slider'}
{else}
{/if} {elseif $catalog_view=='list'}
{elseif $catalog_view=='compact'}
{/if} {if !empty($shuffle)} {$_tmp = shuffle($products)} {/if} {foreach $products as $p} {if is_array($p)} {* Availability *} {$can_buy = false} {$is_available_on_stock = false} {foreach $skus[$p.id] as $sku} {if $sku.available} {$can_buy = true} {if $sku.count >= 1 || $sku.count === null} {$is_available_on_stock = true} {/if} {/if} {/foreach} {if $can_buy} {if $is_available_on_stock} {* in stock *} {$availability_text = $availability.yes} {$availability_status = true} {else} {if $wa->shop->settings('ignore_stock_count')} {* preorder *} {$availability_text = $availability.preorder} {$availability_status = true} {else} {* not in stock *} {$availability_text = $availability.no} {$availability_status = false} {/if} {/if} {else} {* unavailable *} {$availability_text = $availability.unavailable} {$availability_status = false} {/if} {* Images *} {$product_images = []} {if isset($images[$p.id])} {$p.images = $images[$p.id]} {foreach $p.images as $image} {append "product_images" ["src"=>"{$wa->shop->imgUrl($image, '970')}"]} {/foreach} {/if} {* Favorite *} {if in_array($p.id, $favList)} {$favClass = 'active'} {else} {$favClass = ''} {/if} {* Prices *} {capture "prices"}
{if $p.compare_price > 0} {shop_currency_html($p.price)} {shop_currency_html($p.compare_price)} {else} {if $p.min_price != $p.max_price} [`from`] {shop_currency_html($p.min_price)} {*[`to`] {shop_currency_html($p.max_price)}*} {else} {shop_currency_html($p.price)} {/if} {/if}
{/capture} {capture "badges"} {$badge_html = $wa->shop->badgeHtml($p.badge)} {if $badge_html} {$badge_html} {/if} {if $p.compare_price > 0} {if isset($theme_settings.catalog_discount_percent) && $theme_settings.catalog_discount_percent}
-{round(($p.compare_price - $p.price) / ($p.compare_price / 100))}%
{else}
[`Sale`]
{/if} {/if} {/capture} {* Плагин "Характеристики в списках товаров" https://www.webasyst.ru/store/plugin/shop/listfeatures/ *} {if class_exists(shopListfeaturesPlugin)} {capture "listfeatures"} {$shopListfeaturesPlugin = false} {if !empty($set_id)} {$shopListfeaturesPlugin = shopListfeaturesPlugin::display($p, $products, $set_id)} {else} {$shopListfeaturesPlugin = shopListfeaturesPlugin::display($p, $products)} {/if} {if $shopListfeaturesPlugin} {$shopListfeaturesPlugin} {/if} {/capture} {/if} {* Include product template *} {if $catalog_view == 'grid' || $catalog_view == 'slider'} {include file="`$wa_active_theme_path`/products.grid.html" inline} {elseif $catalog_view=='list'} {include file="`$wa_active_theme_path`/products.list.html" inline} {elseif $catalog_view=='compact'} {include file="`$wa_active_theme_path`/products.compact.html" inline} {/if} {/if} {/foreach} {if $catalog_view == 'slider'}
{/if}
{if isset($showpagination) && $showpagination == 1} {if isset($pages_count) && $pages_count > 1}
{capture assign=pagination} {wa_pagination total=$pages_count attrs=['class' => "pagination"]} {/capture} {* Плагин "SEO-фильтр" https://www.webasyst.ru/store/plugin/shop/seofilter/ *} {if $wa->shop && class_exists(shopSeofilterViewHelper)} {shopSeofilterViewHelper::paginationDecorate($pagination)} {else} {$pagination} {/if}
{/if} {/if}