{block name='snippets-filter-search'}
    {et_isShopVersionAtLeast value="5.5.0-rc.1" assign='shopIsAtLeast55'}
    {$limit = $limit|default:-1}
    {$collapseInit = false}
    {$autoScrollTarget=$autoScrollTarget|default:''}

    {foreach $NaviFilter->searchFilterCompat->getOptions() as $searchFilter}
        {if $limit != -1 && $searchFilter@iteration > $limit && !$collapseInit}
            {block name='snippets-filter-search-more-top'}
                <div class="collapse{if $NaviFilter->searchFilterCompat->isActive()} show{/if}" id="box-collps-filter{$NaviFilter->searchFilterCompat->getNiceName()}">
                    <ul class="nav flex-column">
                {$collapseInit = true}
            {/block}
        {/if}
        {block name='snippets-filter-search-navitem'}
            <a rel="nofollow"
                href="{$searchFilter->getURL()}{if !empty($autoScrollTarget)}{$autoScrollTarget}{/if}"
                class="nav-link filter-item{if $searchFilter->isActive()} active{/if}"
            >
                    <div class="box-link-wrapper">
                        <i class="{if $searchFilter->isActive()}{et_getIcon key="filterActive"}{else}{et_getIcon key="filterInactive"}{/if} snippets-filter-item-icon-right"></i>
                        <span class="et-filter-option-name">{$searchFilter->getName()}</span>
                        <span class="badge badge-outline-secondary">{$searchFilter->getCount()}{if $shopIsAtLeast55}<span class="sr-only"> {lang key='productsFound'}</span>{/if}</span>
                    </div>
            </a>
        {/block}
    {/foreach}
    {if $limit != -1 && count($NaviFilter->searchFilterCompat->getOptions()) > $limit}
        {block name='snippets-filter-search-more-bottom'}
                </ul>
            </div>
            <div class="snippets-filter-show-all">
                <button class="btn btn-link"
                    data-toggle="collapse"
                    data-target="#box-collps-filter{$NaviFilter->searchFilterCompat->getNiceName()}"
                    aria-expanded="{if $NaviFilter->searchFilterCompat->isActive()}true{else}false{/if}"
                    aria-controls="box-collps-filter{$NaviFilter->searchFilterCompat->getNiceName()}"
                >
                    {lang key='showAll'}
                </button>
            </div>
        {/block}
    {/if}
{/block}
