{% sw_extends '@Storefront/storefront/component/listing/filter-panel.html.twig' %}
{% block component_filter_panel_header %}
<div class="filter-panel-offcanvas-header">
<div class="h3 filter-panel-offcanvas-only">{{ "listing.filterTitleText"|trans }}</div>
<div
class="filter-panel-offcanvas-only filter-panel-offcanvas-close filter-panel-offcanvas-close--filter" data-offcanvas-sorting-filter-buttons="true">
{# <div class="filter-panel-offcanvas-only filter-panel-offcanvas-close js-offcanvas-close"> #}
{% sw_icon 'schliessen' style {'pack': 'grimmtheme', 'namespace': 'GrimmTheme', 'size': 'xs'} %}
</div>
</div>
{% endblock %}
{% block component_filter_panel_element %}
<div class="filter-panel{% if sidebar %} is--sidebar{% endif %}">
{% block component_filter_panel_items_container %}
<div class="filter-panel-items-container">
{% block component_filter_panel_item_manufacturer %}
{# @var manufacturers \Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\Metric\EntityResult #}
{% set manufacturers = listing.aggregations.get('manufacturer') %}
{% if not manufacturers.entities is empty %}
{% set manufacturersSorted = manufacturers.entities|sort((a, b) => a.translated.name|lower <=> b.translated.name|lower) %}
{% if manufacturersSorted|length > 1 %}
{% sw_include '@Storefront/storefront/component/listing/filter/filter-multi-select.html.twig' with {
elements: manufacturersSorted,
sidebar: sidebar,
name: 'manufacturer',
displayName: 'listing.filterManufacturerDisplayName'|trans|sw_sanitize
} %}
{% endif %}
{% endif %}
{% endblock %}
{% block component_filter_panel_item_price %}
{% set price = listing.aggregations.get('price') %}
{% if price.max > 0 %}
{% sw_include '@Storefront/storefront/component/listing/filter/filter-range.html.twig' with {
price: price,
sidebar: sidebar,
name: 'price',
minKey: 'min-price',
maxKey: 'max-price',
displayName: 'listing.filterPriceDisplayName'|trans|sw_sanitize,
} %}
{% endif %}
{% endblock %}
{% block component_filter_panel_item_shipping_free %}
{# block overwritten to change order: show measures before free shipping #}
{# overwrite plugin logic #}
{% block component_filter_panel_item_additional %}
{# check if category custom field is set #}
{% if page.header.navigation.active.customFields.custom_category_configuration_exclude_measures_filter == false %}
{% set filters = config(constant('\\LoyxxAdditionalListingFilters\\Core\\Services\\ConfigService::CONFIG_DOMAIN') ~ 'availableFilterHandlers') %}
{% if filters is not empty %}
{% set filtersExists = false %}
{% for filter in filters %}
{% if filter in listing.aggregations | keys %}
{% set filtersExists = true %}
{% endif %}
{% endfor %}
{% if filtersExists %}
{% sw_include '@Storefront/solution360/measurements-filter.html.twig' with {"filters" : filters} %}
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
{% if 'freeShipping' not in config(constant('\\LoyxxAdditionalListingFilters\\Core\\Services\\ConfigService::CONFIG_DOMAIN') ~ 'hideStoreFilterHandlers') %}
{% set shippingFree = listing.aggregations.get('shipping-free') %}
{% if shippingFree.max > 0 %}
{% sw_include '@Storefront/storefront/component/listing/filter/filter-boolean.html.twig' with {
name: 'shipping-free',
displayName: 'listing.filterFreeShippingDisplayName'|trans|sw_sanitize
} %}
{% endif %}
{% endif %}
{% endblock %}
{% block component_filter_panel_item_properties %}
{# @var properties \Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\Metric\EntityResult #}
{% set properties = listing.aggregations.get('properties') %}
{% if not properties.entities is empty %}
{% for property in properties.entities %}
{% if property.options|length > 1 %}
{% sw_include '@Storefront/storefront/component/listing/filter/filter-property-select.html.twig' with {
elements: property.options,
sidebar: sidebar,
name: 'properties',
displayName: property.translated.name,
displayType: property.displayType,
pluginSelector: 'filter-property-select',
propertyName: property.translated.name
} %}
{% endif %}
{% endfor %}
{% endif %}
{% endblock %}
{% block component_filter_panel_item_rating_select %}
{{ parent() }}
{% endblock %}
</div>
{% endblock %}
{% block component_filter_panel_active_container %}
<div class="filter-panel-active-container">
{% block component_filter_panel_active_container_inner %}{% endblock %}
</div>
{% endblock %}
</div>
<div class="d-lg-none panel-offcanvas__footer panel-offcanvas__footer--filter">{{ "listing.offcanvas.select"|trans|sw_sanitize }}</div>
{% endblock %}