{$mainCategories = $body.dynamic_filter.parameters[29]}
{$subCategories = $body.dynamic_filter.parameters[28]}

{$filterItemMain = $mainCategories.name|strip_accent}
{$filterItemSub = $subCategories.name|strip_accent}

{$total_filters = $total_filters + 2 scope='global'}

<div class="filter-row filter-id-{$mainCategories.id}">
   <input type="hidden" name="dynamic_filter[parameters][{$mainCategories.id}][type]" value="{$mainCategories.value_type}"
          data-filter-input="{$filterItemMain}">
   <button type="button" class="filter-label" data-opener="[data-opener-param-{$mainCategories.id}]">{$subCategories.name}</button>
   <div class="opener-content" data-opener-param-{$mainCategories.id}>
      <div class="opener-content-inner filter-scrollbar" data-tracking-click="{['target'=>$filterItemMain]|json_encode}">
         {foreach $mainCategories.values as $value}
            <label class="custom-checkbox custom-control check-{$value.id}" for="filter_params[{$mainCategories.id}][{$value.id}]">
               <input class="custom-control-input" type="checkbox"
                      name="dynamic_filter[parameters][29][value][]" value="{$value.id}"
                      data-filter-input="{$filterItemMain}" id="filter_params[{$mainCategories.id}][{$value.id}]"
                       {if $dbcfg.analytics.google_tag_manager.gtm_dl_version == '2'}
                          data-tracking-filter="{['event'=>'applyFilterParams','filtrName'=>$subCategories.name,'filtrId'=>'','filtrValue'=>['name'=>$value.name,'id'=>$value.id,'value'=>'','min'=>'','max'=>'','active'=>'']]|json_encode}"
                       {/if}
                      >
               <span class="custom-control-indicator"></span>
               <span class="custom-control-text">
                  {$value.name}
                  <small>(<span class="filter-count" data-filter-count="{$value.id}">{$value.count}</span>)</small>
               </span>
            </label>
         {/foreach}
      </div>
   </div>
</div>

<div class="filter-row filter-id-{$subCategories.id}">
   <input type="hidden" name="dynamic_filter[parameters][{$subCategories.id}][type]" value="{$subCategories.value_type}"
          data-filter-input="{$filterItemSub}">
   <button type="button" class="filter-label" data-opener="[data-opener-param-{$subCategories.id}]">{t}Typ produktu{/t}</button>
   <div class="opener-content" data-opener-param-{$subCategories.id}>
      <div class="opener-content-inner filter-scrollbar" data-tracking-click="{['target'=>$filterItemSub]|json_encode}">
         {foreach $subCategories.values as $value}
            <label class="custom-checkbox custom-control check-{$value.id}" for="filter_params[{$subCategories.id}][{$value.id}]">
               <input class="custom-control-input" type="checkbox"
                      name="dynamic_filter[parameters][28][value][]" value="{$value.id}"
                      data-filter-input="{$filterItemSub}" id="filter_params[{$subCategories.id}][{$value.id}]"
                       {if $dbcfg.analytics.google_tag_manager.gtm_dl_version == '2'}
                          data-tracking-filter="{['event'=>'applyFilterParams','filtrName'=>'Typ produktu','filtrId'=>'','filtrValue'=>['name'=>$value.name,'id'=>$value.id,'value'=>'','min'=>'','max'=>'','active'=>'']]|json_encode}"
                       {/if}
                      >
               <span class="custom-control-indicator"></span>
               <span class="custom-control-text">
                  {$value.name}
                  <small>(<span class="filter-count" data-filter-count="{$value.id}">{$value.count}</span>)</small>
               </span>
            </label>
         {/foreach}
      </div>
   </div>
</div>
