Files
kupshop/web/templates/koza/category.tpl
2025-08-02 16:30:27 +02:00

294 lines
13 KiB
Smarty

{extends "index.tpl"}
{block "css" append}
{encore_entry_link_tags entry='category'}
{/block}
{block "header-title"}
<title>
{if $body.category.plural and !$body.category.meta_title and !$body.producer}
{$body.category.plural} - {$dbcfg.shop_title}
{elseif !$body.category.id and $body.category.campaign == "N" and !$body.producer}
{t}Novinky parfémů a kosmetiky{/t} - {$dbcfg.shop_title}
{else}
{$header.pageTitle}
{/if}
</title>
{/block}
{block "body-container-data"}data-filter_form{/block}
{block "google_tag_manager"}
{if $body.category.id}
{insert_products type="bestsellingProductsInSection" id_section=$body.category.id id_producer=$body.producer.id count=5 offset=NULL image=11 instore=true
template=null assign='bestsellingproducts'}
{/if}
{include 'block.analytics.gtm.tpl' pageType='category' bestsellingproducts=$bestsellingproducts}
{/block}
{block "body-container-class"}{if $body.category.id == $cfg.special.catId}xmas-root{/if}{/block}
{block "body-content"}
{if $body.category.flags['TT']}
{include "category.top_ten.tpl"}
{else}
{* root specalni kategorie, napr. vanocni rozcestnik, zobrazi se jen pokud je admin nebo zapnuty v cfg *}
{if $body.category.id == $cfg.special.catId}
{$xmasRoot = true}
{elseif $ctrl.currUrl.Rel|strstr:$cfg.special.catId}
{$xmasChild = true}
{/if}
{if $dbcfg.valentine == true and $body.category.id == $cfg.special.valentine.catId}
{$valentineRoot = true}
{/if}
{if $dbcfg.valentine == true and $ctrl.currUrl.Rel|strstr:$cfg.special.valentine.catId}
{$valentineChild = true}
{/if}
{* Specialni akce (vanoce, atd) skryje filtr + leve menu *}
{if $xmasChild or $xmasRoot or $valentineRoot}
{$fullWidth = true}
{/if}
{if $body.category.flags.C and $body.category.flags.P}
{$fullWidth = true}
{/if}
{block 'categoryName'}
{function categoryName}
{if $responsive}
{if $body.category.name == "Kazety"}
{* nazev kategorie kazety + filtr kazety -> nazev "kazety - kazety" *}
{* je potreba ve "specialni akci" a v kazetach muzi + zeny dohromay *}
<p class="h1 hidden-md-up text-center m-b-2">Kazety</p>
{elseif !$body.category.id and $body.category.campaign == "N"}
<p class="h1 hidden-md-up text-center m-b-2">{t}Novinky parfémů a kosmetiky{/t}</p>
{else}
<p class="h1 hidden-md-up text-center m-b-2">{$view->getTitle()}</p>
{/if}
{else}
{if $body.category.name == "Kazety"}
<h1 class="{if !$fullWidth}hidden-sm-down {/if}text-center m-b-2">Kazety</h1>
{elseif !$body.category.id and $body.category.campaign == "N"}
<h1 class="hidden-sm-down text-center m-b-2">{t}Novinky parfémů a kosmetiky{/t}</h1>
{else}
<h1 class="{if !$fullWidth}hidden-sm-down {/if}text-center m-b-2">{$view->getTitle()}</h1>
{/if}
{/if}
{/function}
{/block}
<div class="row" data-filter="wrapper">
{if !$fullWidth}
<div class="col-xxl-2 col-md-3 col-xs-12" id="side-menu">
{categoryName responsive=true}
{* kategorie se nezobrazi pri zobrazeni vyrobce, kampane + kategorie muzi nebo zeny, oblibenych, wolfovi, sleve a kampnani "skryt sekce" *}
{if !$body.producer and !($body.category.campaign && $body.category.id <= 2 ) and $body.category.campaign != 'F'
and !$body.category.is_watchdog and !$body.isDiscountCategory and !$body.category.flags.C}
<div class="side-sections hidden-sm-down">
{insert_sections level=1}
</div>
{/if}
{block "category-filter"}
{if !$body.category.flags.P}
{include "filter.tpl"}
{/if}
{if !$body.producer and !$body.category.campaign and !$body.isDiscountCategory}
<h4>
<a href="" class="hidden-md-up" data-burger data-toggle="burger">{t}Zobrazit kategorie{/t}</a>
</h4>
{/if}
{/block}
</div>
{/if}
{if $fullWidth or $body.category.flags.P}
<div style="display:none;"> {* potrebuji JS ale nepotrebuji inputy *}
{include "filter.tpl"}
</div>
{/if}
<div class="{if !$fullWidth}col-md-9 col-xxl-10 {/if}col-xs-12">
{categoryName}
{if $body.category.flags.S}
<p class="text-center pick-perfume-title"><span class="fc icons_tip">&nbsp;</span> <a
href="#category-how-to" data-scroll>Jak vybrat nejvhodnější vůni?</a></p>
{/if}
{if $body.category.virtual == "Y"}
<div class="category-top-description">
{foreach $body.category.blocks as $block}
{$block|inline_edit nofilter}
{/foreach}
</div>
{elseif $body.producer.blocks|count > 1}
<div class="category-top-description">
{foreach $body.producer.blocks->slice(1) as $block}
{$block|inline_edit nofilter}
{/foreach}
</div>
{/if}
{block 'category-slider'}
{if $body.category.id_slider}
<div class="category-slider">
{insert_slider id=$body.category.id_slider sliderClass="slider"}
</div>
{/if}
{/block}
{if $xmasRoot}
{insert_subsections template="block.subsections.christmas.tpl" category=$body.category root=true}
{elseif $valentineRoot}
{insert_subsections template="block.subsections.valentine.tpl" category=$body.category root=true}
{elseif $xmasChild}
{insert_subsections template="block.subsections.christmas.tpl" category=$body.category}
{elseif $valentineChild}
{insert_subsections template="block.subsections.valentine.tpl" category=$body.category}
{elseif $body.category.parents|count < 2 and $body.category.id and !$body.category.campaign} {* jen v prvni urovni *}
{insert_subsections category=$body.category up=false}
{/if}
{if $body.productsList|count and !($xmasRoot or $valentineRoot)}
{if $body.category.id and $body.returnNav[0][1].ID <= 4 and $body.productsList|count > 5 and !$body.category.campaign and $body.category.virtual != "Y"}
{include "block.products.top.tpl" products=$bestsellingproducts.products}
{/if}
<div class="products-wrapper">
<form data-filter="form">
<div class="row sorting-row">
<div class="col-xl-5 col-xs-12 category-ordering" id="ordering">
<input type="hidden" name="order_by"
value="{$body.ordering.order_by|default:$body.category.orderby}">
<input type="hidden" name="order_dir"
value="{$body.ordering.order_dir|default:$body.category.orderdir}">
<label for="sort" class="m-r-2">{t}Seřadit podle:{/t}</label>
<select class="custom-select custom-control" name="sort" id="sort"
data-filter-input="{t}razeni{/t}">
{block sortInputValues}
<option value="-5"
{if $body.category.orderby == 5 && $body.category.orderdir == 2}selected{/if}>{t}Nejprodávanější{/t}</option>
<option value="3"
{if $body.category.orderby == 3 && $body.category.orderdir == 1}selected{/if}>{t}Nejlevnější{/t}</option>
<option value="-3"
{if $body.category.orderby == 3 && $body.category.orderdir == 2}selected{/if}>{t}Nejdražší{/t}</option>
{/block}
</select>
<div class="products-total">
<div data-reload="pagerTotal">
{$body.pager.total}
{t plural="produkty" plural5="produktů" count=$body.pager.total}produkt{/t}
</div>
</div>
</div>
<div class="col-xl-7 col-xs-12 pager-col">
{if $body.pager.count > 1 || isAjax()}
<div class="pager-top" id="pager-top" data-reload="pager-top">
<div class="hidden-lg-down">
{include "block.pager.tpl" pager=$body.pager}
</div>
</div>
{/if}
</div>
</div>
<div class="filter-selected row m-x-0 empty" data-filter-reset="wrap">
<div class="filter-selected-list">
<p class="m-b-0 pull-left hidden-md-up">{t}Seznam je omezen{/t}</p>
<p class="m-b-0 pull-left hidden-sm-down">{t}Seznam je omezen na:{/t}</p>
<div data-filter-reset="items" class="hidden-sm-down">
<div class="filter-selected-item" data-filter-reset="template">
<span data-filter-reset="item-label"></span><a href="" class="delete"
data-filter-reset="reset-item"><span
class="fc icons_close-lg"></span></a>
</div>
</div>
<a href="" id="reset-filter" class="reset" data-filter-reset="reset">{t}Zrušit filtry{/t}
<span class="fc icons_close_circle"></span></a>
</div>
</div>
</form>
<div data-filter="products">
<div data-reload="products">
{if $fullWidth}
{include "block.products.catalog.tpl" products=$body.productsList catalog_class='col-xl-5ths col-lg-3 col-sm-6 col-xs-12'}
{else}
{include "block.products.catalog.tpl" products=$body.productsList}
{/if}
</div>
</div>
{if $body.pager.count > 1}
<div class="pager-bottom" data-reload="pager-bottom">
{include "block.pager.tpl" pager=$body.pager}
</div>
{/if}
</div>
{elseif !$xmasRoot and !$valentineRoot}
<div data-reload="products">
<div class="alert alert-info" role="alert">
{t}Žádný produkt{/t}
</div>
</div>
{/if}
{if $body.category.virtual != "Y"}
{if $body.category.descr and !$body.producer}
<div class="category-description">
{$body.category.descr|markdown2html nofilter}
</div>
{/if}
{if $body.producer.descr and !$body.category.id}
<div class="category-description">
{if $cfg.Lang.language == "czech" or $cfg.Lang.language == "cs"}
<h2 class="text-center m-b-1">{t znacka=$body.producer.name}Popis značky {znacka}{/t}</h2>
{/if}
{foreach $body.producer.blocks->slice(0,1) as $block}
{$block.content|markdown2html nofilter}
{/foreach}
</div>
{/if}
{/if}
{block "how-to-choose"}
{/block}
</div>
</div>
{/if}
{/block}
{block "js-entry" append}
{encore_entry_script_tags entry='category'}
{/block}
{block "js-dynamic-load" append}
{asset_compile}
{if $body.category.flags['TT']}
<script src="/static/js/wpj.top-ten.js"></script>
{/if}
{/asset_compile}
{/block}
<script>
{block onready append}
// Openers
wpj.domUtils.initOpeners();
// jak vybrat nej vuni
$('[data-scroll]').on('click', function() {
var href = $(this).attr('href');
wpj.domUtils.scrollTo($(href));
return false;
});
{/block}
</script>