{% sw_extends '@Storefront/storefront/component/listing/filter-panel.html.twig' %}
{% block component_filter_panel_items_container %}
{% if listing.extensions.acrisFilter.sortedFilters %}
{% set sortedFilters = listing.extensions.acrisFilter.sortedFilters %}
{% set hidedValue = false %}
{% for filter in sortedFilters %}
{% if filter.hide == true %}
{% if filter.identifier == 'price' %}
{% set price = listing.aggregations.get('price') %}
{% if price.min > 0 and price.max > 0 %}
{% set hidedValue = true %}
{% endif %}
{% elseif filter.identifier == 'manufacturer' %}
{% set manufacturers = listing.aggregations.get('manufacturer') %}
{% if not manufacturers.entities is empty %}
{% set hidedValue = true %}
{% endif %}
{% elseif filter.identifier == 'rating' %}
{% set rating = listing.aggregations.get('rating') %}
{% if not rating is empty %}
{% set hidedValue = true %}
{% endif %}
{% elseif filter.identifier == 'shipping-free' %}
{% set shippingFree = listing.aggregations.get('shipping-free') %}
{% if shippingFree.max > 0 %}
{% set hidedValue = true %}
{% endif %}
{% elseif filter.identifier == 'categories' %}
{# @var categories \Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\Metric\EntityResult #}
{% set categories = listing.aggregations.get('categories').extensions.acrisCategoryFilterAggregationTree.tree %}
{% if categories is not empty %}
{% set hidedValue = true %}
{% endif %}
{% else %}
{% set hidedValue = true %}
{% endif %}
{% endif %}
{% if filter.identifier == 'properties' %}
{# @var properties \Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\Metric\EntityResult #}
{% set properties = listing.aggregations.get('properties') %}
{% if properties.entities is not empty %}
{% for property in properties.entities %}
{% if property.translated.customFields.acris_filter_hide == true %}
{% set hidedValue = true %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% block acris_filter_hidden_filters_loop %}
{% set randomIdForFilter = random(0,1000) %}
<div class="filter-panel-items-container{% if sidebar == false %} acris-filter-inline{% endif %} {% if config('AcrisFilterCS.config.disableFilterOptions') == 'hide' %} acris-hide-disabled-filters{% endif %}">
{% for filter in sortedFilters %}
{% if filter.identifier == 'properties' %}
{% set properties = listing.aggregations.get('properties') %}
{% if properties.entities is not empty %}
{% for property in properties.entities %}
{% if property.translated.customFields.acris_filter_hide != true %}
{% sw_include '@AcrisFilterCS/storefront/component/acris-filter-listing/acris-filter-listing.html.twig' with {
propertyID: property.id
} %}
{% endif %}
{% endfor %}
{% endif %}
{% else %}
{% if filter.hide != true %}
{% sw_include '@AcrisFilterCS/storefront/component/acris-filter-listing/acris-filter-listing.html.twig' %}
{% endif %}
{% endif %}
{% endfor %}
<div
class="collapse filter-panel-items-container{% if sidebar == false %} acris-filter-inline{% endif %}"
id="filterCollapsed-{{ randomIdForFilter }}">
{% for filter in sortedFilters %}
{% if filter.identifier == 'properties' %}
{% set properties = listing.aggregations.get('properties') %}
{% if properties.entities is not empty %}
{% for property in properties.entities %}
{% if property.translated.customFields.acris_filter_hide == true %}
{% sw_include '@AcrisFilterCS/storefront/component/acris-filter-listing/acris-filter-listing.html.twig' with {
propertyID: property.id
} %}
{% endif %}
{% endfor %}
{% endif %}
{% else %}
{% if filter.hide == true %}
{% sw_include '@AcrisFilterCS/storefront/component/acris-filter-listing/acris-filter-listing.html.twig' %}
{% endif %}
{% endif %}
{% endfor %}
</div>
{% if hidedValue == true %}
<div class="filter-multi-select filter-multi-select-manufacturer filter-panel-item dropdown">
{% block page_product_detail_acris_supplies_upselling_article_button %}
<button id="btnShowItems"
class="{% if sidebar == false %}filter-panel-item-toggle btn collapsed{% else %}btn btn-block collapsed{% endif %}"
type="button"
data-toggle="collapse"
data-target="#filterCollapsed-{{ randomIdForFilter }}"
aria-expanded="true"
aria-controls="filterCollapsed-{{ randomIdForFilter }}"
title="{{ "acrisFilter.buttonFilterShowHideLabel"|trans|striptags }}"
aria-label="{{ "acrisFilter.buttonFilterShowHideLabel"|trans|striptags }}">
<span class="if-collapsed">
{{ "acrisFilter.buttonFiltersShow"|trans|sw_sanitize }}
{% sw_icon 'arrow-medium-down' style {'pack': 'solid', 'size': 'xs', 'class': 'filter-panel-item-toggle'} %}
</span>
<span class="if-not-collapsed">
{{ "acrisFilter.buttonFiltersHide"|trans|sw_sanitize }}
{% sw_icon 'arrow-medium-up' style {'pack': 'solid', 'size': 'xs', 'class': 'filter-panel-item-toggle'} %}
</span>
</button>
{% endblock %}
</div>
{% endif %}
</div>
{% endblock %}
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}
{% block component_filter_panel_active_container %}
{% if config('AcrisFilterCS.config.showActiveFilter') %}
<div class="filter-panel-active-container"></div>
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}