{block name='snippets-filter-genericFilterItem'}
    {et_isShopVersionAtLeast value="5.5.0-rc.1" assign='shopIsAtLeast55'}
    {et_isShopVersionAtLeast value="5.7.0-rc.3" assign='shopIsAtLeast57'}
    {$autoScrollTarget=$autoScrollTarget|default:''}
    {block name='snippets-filter-genericFilterItem-nav'}
        {$limit = $limit|default:-1}
        {$collapseInit = false}
            {foreach $filter->getOptions() as $filterOption}
                {if $limit != -1 && $filterOption@iteration > $limit && !$collapseInit}
                    {block name='snippets-filter-genericFilterItem-more-top'}
                        <div class="collapse{if $filter->isActive()} show{/if}" id="box-collps-filter{$filter->getNiceName()}">
                            {$collapseInit = true}
                    {/block}
                {/if}
                {assign var=filterIsActive value=$filterOption->isActive() || $NaviFilter->getFilterValue($filter->getClassName()) === $filterOption->getValue()}
                {block name='snippets-filter-genericFilterItem-nav-main'}
                    {$href = "{if $filterOption->isActive()}{$filter->getUnsetFilterURL($filterOption->getValue())}{else}{$filterOption->getURL()}{/if}{if !empty($autoScrollTarget)}{$autoScrollTarget}{/if}"}
                    <a class="nav-link filter-item{if $filterIsActive === true} active{/if}"
                        {if $shopIsAtLeast57 && $Einstellungen.prgpattern.prg_pattern_enabled !== 'N'}
                            data-prg-href="{$href|default:''|base64_encode}"
                            href="#"
                        {else}
                            href="{$href}"
                        {/if}
                        rel="nofollow"
                    >
                        <div class="box-link-wrapper">
                            {if $filter->getIcon() !== null}
                                <i class="fa fab fas far {$filter->getIcon()} snippets-filter-item-icon-right"></i>
                            {else}
                                <i class="{if $filterIsActive === true}{et_getIcon key="filterActive"}{else}{et_getIcon key="filterInactive"}{/if} snippets-filter-item-icon-right"></i>
                            {/if}
                            {if $filter->getNiceName() === 'Rating'}
                                {block name='snippets-filter-genericFilterItem-include-rating-nav'}
                                    <span class="snippets-filter-item-icon-right">{include file='productdetails/rating.tpl' stars=$filterOption->getValue()}</span>
                                {/block}
                            {/if}
                            <span class="et-filter-option-name">{$filterOption->getName()}</span>
                            <span class="badge badge-outline-secondary">{$filterOption->getCount()}{if $shopIsAtLeast55}<span class="sr-only"> {lang key='productsFound'}</span>{/if}</span>
                        </div>
                    </a>
                {/block}
            {/foreach}
            {if $limit != -1 && count($filter->getOptions()) > $limit}
                {block name='snippets-filter-genericFilterItem-more-bottom'}
                    </div>
                    <div class="snippets-filter-show-all">
                        <button class="btn btn-link"
                            data-toggle="collapse"
                            data-target="#box-collps-filter{$filter->getNiceName()}"
                            aria-expanded="{if $filter->isActive()}true{else}false{/if}"
                            aria-controls="box-collps-filter{$filter->getNiceName()}"
                        >
                            {lang key='showAll'}
                        </button>
                    </div>
                {/block}
            {/if}
    {/block}
{/block}
