Ежегодная распродажа Webasyst с 28 ноября по 2 декабря Купить решения со скидкой 50%
База знаний
Бренды PROFAQ (Общие вопросы)Интеграция с OZONИнтеграция с Яндекс.МаркетЭкспорт в YML PROИнтеграция с AliExpressSEO-фильтрMeta Robots TagИнформация о доставке и оплатеЧасто задаваемые вопросыГруппы товаровSEO-оптимизацияКаталог отзывовGoogle ПокупкиЭлектронная коммерцияПоиск PROSEO-регионыТурбо-страницыSEO-редиректыLink canonical ​Last-Modified​Заказ обратного звонка​HTML-карта сайта​Навигация в хлебных крошкахКупить в 1 кликКупить в 1 клик 2.0Sitemap PROЗаказ в 1 шагМассовые измененияЗащита контента для Shop-ScriptАвтообновление курса валют Защита контента для приложения «Блог»Передача заказов из корзин Турбо-страницFast indexЦены ProИнтеграция с МегаМаркетMobisite 3.0Megashop 3.0MobiSite 2.0MegaShop 2.0VK пиксель PROЭквайринг EpayБлижайший срок доставкиДополнительный поиск товаров в категорииТриггеры PROПоделиться корзинойОбновление остатков и цен по коду артикулаОбщие вопросы
Войдите в личный кабинет для возможности задавать вопросы и отвечать на комментарии.
FAQ

Вывод фильтрации в теме дизайна Supermarket

Поддержка Bodysite
Поддержка Bodysite
14 ноября 2022 13:56
+1

Если у вас тема дизайна Supermarket и не выводится фильтрация в каталоге бренда, хотя в редактировании бренда она включена, то нужно изменить код шаблона.

"Шаблон страницы бренда (Каталог)"

Полный изменённый код шаблона:

{* Catalog types *}
{if !empty($theme_settings.catalog_type)}{if $theme_settings.catalog_type == 'text'}{$catalog_show = 'text'}{elseif $theme_settings.catalog_type == 'list'}{$catalog_show = 'list'}{else}{$catalog_show = 'thumbs'}{/if}{/if}
{$shop_view = waRequest::cookie('show', '', waRequest::TYPE_STRING)}
{if $shop_view}{$catalog_show = $shop_view}{/if}

{$compare_p = waRequest::cookie('shop_compare', array(), waRequest::TYPE_ARRAY_INT)}
{$favorite_p = waRequest::cookie("shop_favorite", '', waRequest::TYPE_STRING)}
{$view_p = waRequest::cookie("shop_view", '', waRequest::TYPE_STRING)}

{if empty($filters)}
    {$count = 5}
{else}
    {$count = 4}
{/if}

{strip}
    <script src="{$wa_theme_url}js/lazyloading.min.js?v{$wa_theme_version}"></script>
    <div class="category container">
        
        
            {if !empty($filters)}
        <div class="category__leftside">
    <div class="filter hide-xs-opacity">
        <div class="filters ajax">
            <div class="filters__name">[`Filters`]
                <div class="close-block js-close-filters"><svg class="icon-close-tin" viewBox="0 0 14 14"><use xlink:href="#icon-close-tin"></use></svg></div>
            </div>
            <form method="get" action="{$wa->currentUrl(0,1)}" data-loading="{$wa_theme_url}img/loader/tail-spin.svg" class="filterform">
                {foreach $filters as $fid => $filter}
                    {if $fid == 'price'}
                        {$c = $wa->shop->currency(true)}
                        <div class="filtergroup open">
                            <div class="panel-body panel-price">
                                [`Price`]
                                <div class="icon"><i class="fas fa-chevron-down"></i></div>
                            </div>
                            <div class="slider sliderunit slideblock rangefilter">
                                <input type="text" class="min" name="price_min" {if $wa->get('price_min')}value="{(int)$wa->get('price_min')}"{/if} placeholder="{floor($filter.min)}">&nbsp;&nbsp;&#8212;&nbsp;&nbsp;<input type="text" class="max" name="price_max" {if $wa->get('price_max')}value="{(int)$wa->get('price_max')}"{/if} placeholder="{ceil($filter.max)}">
                            </div>
                        </div>
                    {else}
                        <div class="filtergroup {if $theme_settings.catalog_filter == 2  && !$wa->isMobile()}open{/if}">
                            <div class="panel-body"{if $filter@iteration == 1} style="border-top:0px;"{/if}>
                                {$filter.name|escape}
                                <div class="icon"><i class="fas fa-chevron-down"></i></div>
                            </div>
                            {if $filter.type == 'boolean'}
                                <div class="slideblock">
                                    <div class="checkboxfilter">
                                        <label class="radio custom-radio"><input type="radio" name="{$filter.code}" {if $wa->get($filter.code)}checked{/if} value="1"> <span>[`Yes`]</span></label>
                                    </div>
                                    <div class="checkboxfilter">
                                        <label class="radio custom-radio"><input type="radio" name="{$filter.code}" {if $wa->get($filter.code) === '0'} checked{/if} value="0"> <span>[`No`]</span></label>
                                    </div>
                                    <div class="checkboxfilter">
                                        <label class="radio custom-radio"><input type="radio" class="any" name="{$filter.code}"{if $wa->get($filter.code, '') === ''} checked{/if} value=""> <span>[`Any`]</span></label>
                                    </div>
                                </div>
                            {elseif $filter.type == "range.date"}
                                {$_v = $wa->get($filter.code)}

                                <div class="slider sliderdate slideblock">
                                    <div class="rangefilter diaposon">
                                        <input type="text" class="min" name="{$filter.code}[min]" placeholder="{$filter.min}" {if !empty($_v.min)}value="{$_v.min}"{/if}>&nbsp;&nbsp;&#8212;&nbsp;&nbsp;
                                        <input type="text" class="max" name="{$filter.code}[max]" placeholder="{$filter.max}" {if !empty($_v.max)}value="{$_v.max}"{/if}>
                                    </div>
                                </div>
                            {elseif isset($filter.min)}

                                {$_v = $wa->get($filter.code)}
                                <div class="slider sliderunit slideblock">
                                    <div class="rangefilter diaposon">
                                        <input type="text" class="min" name="{$filter.code}[min]" placeholder="{$filter.min}" {if !empty($_v.min)}value="{$_v.min}"{/if}>&nbsp;&nbsp;&#8212;&nbsp;&nbsp;<input type="text" class="max" name="{$filter.code}[max]" placeholder="{$filter.max}" {if !empty($_v.max)}value="{$_v.max}"{/if}>
                                        {if !empty($filter.unit)}
                                            <span class="unit">{$filter.unit.title}</span>{if $filter.unit.value != $filter.base_unit.value}
                                            <input type="hidden" name="{$filter.code}[unit]" value="{$filter.unit.value}">{/if}{/if}
                                    </div>
                                </div>
                            {else}
                                <div class="group-filter slideblock scroll_div" {if $theme_settings.catalog_filter == 1 || $wa->isMobile()}style="display:none;"{/if}>
                                    {foreach $filter.values as $v_id => $v}

                                        {if class_exists('shopSeofilterViewHelper')}
                                            {$filter_url = shopSeofilterViewHelper::getFilterUrl($filter.id, $v_id, $filter.code)}
                                        {/if}
                                        <div class="checkboxfilter">
                                            <label class="checkbox custom-checkbox"><input type="checkbox" name="{$filter.code}[]" {if in_array($v_id, (array)$wa->get($filter.code, array()))}checked{/if} value="{$v_id}" data-code="{$filter.code}{$v_id}" data-name="{$v|strip_tags}">
                                                <span>{if !empty($filter_url)}<a class="filter-link" href="{$filter_url}">{$v}</a>{else}{$v}{/if}</span>
                                            </label>
                                        </div>
                                    {/foreach}
                                </div>
                            {/if}
                        </div>
                    {/if}
                {/foreach}
                {if $wa->get('sort')}
                    <input type="hidden" name="sort" value="{$wa->get('sort')|escape}">{/if}
                {if $wa->get('order')}
                    <input type="hidden" name="order" value="{$wa->get('order')|escape}">{/if}
                <div class="filtergroup">
                <div class="fsubmit">
                    <a href="javascript:void(0);" class="button hide-lg hide-md hide-sm js-close-filters">[`Apply`]</a>
                    {$cat_url = $wa->shop->category($category.id)}
                    <a href="{$wa->shop->categoryUrl($cat_url)}" class="button clear-filter outline black">[`Clear filter`]</a>
                </div>
                </div>
            </form>
        </div>
    </div>
    </div>
{/if}

<div class="category__rightside">

            {* Favorite *}
            {if $wa->get('view') == 'favorite'}

                {$wa->title('[`Favorite`]')}
                <div class="header-container">
                    <div class="header-container__name">
                        <h1>[`Favorite`] ({if $favorite_p}{count(explode(',', $favorite_p))}{else}0{/if})</h1>
                    </div>
                    {if $favorite_p}
                        <div class="header-container__func is-vertical-align is-right">
                            <svg class="icon-close-tin" viewBox="0 0 30 30">
                                <use xlink:href="#icon-close-tin"></use>
                            </svg>
                            <a href="javascript:void(0);" class="clearfavorite">[`Clear list`]</a>
                        </div>
                    {/if}
                </div>

                {if !$favorite_p}
                    <div id="product-list">
                        <p>[`No products were found.`]</p>
                        {if $theme_settings.logo_link}<a href="{$theme_settings.logo_link}">{else}
                            <p><a href="{$wa_app_url}"  class="button outline black">{/if}[`Go to home page`]</a></p>
                    </div>
                {else}

                    {$products_ = $wa->shop->products('id/'|cat:$favorite_p)}
                    {$products = []}
                    {foreach explode(',', $favorite_p) as $a}
                        {$products[] = $products_[$a]}
                    {/foreach}
                    <div data-type="favorite">
                        {include file="`$wa_active_theme_path`/list-thumbs.html" products=$products actions="favorite"}
                    </div>
                {/if}

            {* Seen product *}
            {elseif $wa->get('view') == 'seen'}

                {$wa->title('[`You watched`]')}
                <div class="header-container">
                    <div class="header-container__name">
                        <h1>[`You watched`] ({if $view_p}{count(explode(',', $view_p))}{else}0{/if})</h1>
                    </div>
                    {if $view_p}
                        <div class="header-container__func is-vertical-align is-right">
                            <svg class="icon-close-tin" viewBox="0 0 30 30">
                                <use xlink:href="#icon-close-tin"></use>
                            </svg>
                            <a href="javascript:void(0);" class="clearview">[`Clear list`]</a>
                        </div>
                    {/if}
                </div>
                {if !$view_p}
                    <div id="product-list">
                        <p>[`No products were found.`]</p>

                    </div>
                {else}
                    {$products_ = $wa->shop->products('id/'|cat:$view_p)}
                    {$products = []}
                    {foreach explode(',', $view_p) as $a}
                        {$products[] = $products_[$a]}
                    {/foreach}

                    {include file="`$wa_active_theme_path`/list-thumbs.html" products=$products}

                {/if}

            {* Ajax search *}
            {elseif  $wa->get('view') == 'ajax_search'}

                {if $products}
                <div class="search-ajax">
                    <div class="header__search__popup">
                    <div class="header__search__popup-title">
                        [`Found`] <span class="header__search__popup-title-count"><span class="cart-count">{$products_count}</span> шт.</span>
                    </div>
                    <div class="header__search__popup-scroll">
                        {foreach $products|@array_slice:0:10 as $a}
                            <div class="header__search__popup-inner" data-id="{$a.id}">
                                <div class="header__search__popup-img">
                                    <a href="{$a.frontend_url}">{$wa->shop->productImgHtml($a, '400x0', ['itemprop' => 'image', 'alt' => $a.name, 'default' => "`$wa_theme_url`img/no-foto-catalog.png"])}</a>
                                </div>
                                <div class="header__search__popup-text ">
                                    <div class="header__search__popup-name">
                                        <a href="{$a.frontend_url}">{$a.name}</a>
                                    </div>
                                    <div class="header__search__popup-block">
                                        <div class="header__search__popup-price is-vertical-align">
                                            {shop_currency_html($a.price)}
                                            {if $a.compare_price > 0}<s>{shop_currency_html($a.compare_price)}</s>{/if}
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {/foreach}
                    </div>
                    <div class="header__search__popup-checkout">
                        <div class="header__search__popup-checkout-btn"><a href="javascript:void(0);" class="button">[`Show all`] ({$products_count})</a></div>
                        <div class="header__search__popup-total is-vertical-align"><a href="javascript:void(0);" class="js-hide-search-popup">[`Close`]</a></div>
                    </div>
                </div>
            {/if}

            {else}

            {* @event frontend_search.%plugin_id% *}
            {foreach $frontend_search as $_}{$_}{/foreach}
            {if $title}<p>[`Query`]: <b>{$title|escape}</b></p>{/if}
            <div id="product-list">
                {if !$products}
                    {if !empty($filters)}
                        <p>[`No products were found.`]</p>
                {if $theme_settings.logo_link}<a href="{$theme_settings.logo_link}">{else}
                    <p><a href="{$wa_app_url}"  class="button outline black">{/if}[`Go to home page`]</a></p>
                    {else}
                        <p>[`This category does not contain any products.`]</p>
                    {if $theme_settings.logo_link}<a href="{$theme_settings.logo_link}">{else}
                        <p><a href="{$wa_app_url}"  class="button outline black">{/if}[`Go to home page`]</a></p>
                    {/if}

                {else}

                    {* Thumbs views *}

                    {include file="`$wa_active_theme_path`/list-thumbs.html" products=$products count=$count}

                    {if isset($pages_count) && $pages_count > 1}
                        <div {if $theme_settings.catalog_pagination == 'lazyload'}class="lazyloading-paging"{/if}>
                            {wa_pagination total=$pages_count attrs=['class' => "c-pagination"]}
                        </div>
                    {/if}

                {/if}

                {/if}

            </div>
    </div>
    </div>
{/strip}

0 комментариев
Добавить комментарий
Чтобы добавить комментарий, войдите в личный кабинет