<div data-reload="pagerTotal">{$body.pager.total} {t plural="produkty" plural5="produktů" count=$body.pager.total}produkt{/t}</div>

{if $body.pager.count > 1}
   <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 data-reload="products">
   {if $body.productsList|count}
      {block "productslist"}
         {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}
      {/block}
   {else}
      <div class="alert alert-info" role="alert">
         {* @formatter:off *}{t odkaz=$ctrl.urrUrl.Rel escape=false}Žádný produkt neodpovídá výběru. Přejete si <a href="{odkaz}">zrušit filtry</a>?{/t}{* @formatter:on *}
      </div>
   {/if}

   <script data-reload="filter-script">
      var $filter = $('[data-filter_form]').data('wpjCategoryFilter');
      {* @formatter:off *}
      $filter.updateItemsState(
         {
            {if !$body.producer}
            '{t}vyrobce{/t}': {$body.dynamic_filter.filter->getProducers()|json_encode nofilter},
            {else}
            '{t}rada{/t}': {$body.dynamic_filter.filter->getSeries()|json_encode nofilter},
            {/if}
            '{t}cena{/t}': {$body.dynamic_filter.filter->getPriceRange()|json_encode nofilter},
            '{t}pohlavi{/t}': {$body.dynamic_filter.filter->getSex()|json_encode nofilter},
            '{t}velikost{/t}': {$body.dynamic_filter.filter->getSizes()|json_encode nofilter},

            {foreach $body.dynamic_filter.parameters as $id => $parameter}
            {$inputId = $parameter.name|strip_accent}
            {if $parameter.value_type != "float" and $inputId != "{t}pohlavi{/t}" and $inputId != "{t}kategorie{/t}"}
            {$values = $body.dynamic_filter.filter->getParameter($id, $parameter.value_type)}
            '{$inputId}': {
               'values': {$values.values|json_encode nofilter}
            },
            {/if}
            {/foreach}

            {if $body.category.campaign and $body.category.id and $body.category.id <= 3}
            '{t}kategorie{/t}': {insert_sections level=1 level_max=1 skip_cache=1 template="block.sections.filter.data.tpl"},
            {elseif $body.producer or ($body.category.campaign and !$body.category.id) or $body.category.is_watchdog or $body.category.flags.F or $body.dynamic_filter.parameters[28]}
            {$values = $body.dynamic_filter.filter->getParameter(28, 'list')}
            '{t}kategorie{/t}': {
               'values': {$values.values|json_encode nofilter}
            },
            {/if}
            '': ''
         }
      );
      {* @formatter:on *}
      $filter.updateReset();
   </script>
</div>

{if $body.pager.count > 1}
   <div class="pager-bottom" data-reload="pager-bottom">
      {include "block.pager.tpl" pager=$body.pager}
   </div>
{/if}

<span data-reload="pagerTotal-responsive">
  {t plural="zobrazit {$body.pager.total} produkty" plural5="zobrazit {$body.pager.total} produktů"
  count=$body.pager.total pocet=$body.pager.total}zobrazit {pocet} produkt{/t}
</span>
