vendor/shopware/storefront/Resources/views/storefront/component/listing/filter-panel.html.twig line 1

  1. {% block component_filter_panel %} {# merge 16.11.20 #}
  2.     {% block component_filter_panel_header %}
  3.         <div class="filter-panel-offcanvas-header">
  4.             <div class="filter-panel-offcanvas-only filter-panel-offcanvas-title">{{ "listing.filterTitleText"|trans }}</div>
  5.             <div class="filter-panel-offcanvas-only filter-panel-offcanvas-close js-offcanvas-close">
  6.                 {% sw_icon 'x' style { 'size': 'md' } %}
  7.             </div>
  8.         </div>
  9.     {% endblock %}
  10.     {# @var listing \Shopware\Core\Framework\DataAbstractionLayer\Search\EntitySearchResult #}
  11.     {% block component_filter_panel_element %}
  12.         <div class="filter-panel{% if sidebar %} is--sidebar{% endif %}">
  13.             {% block component_filter_panel_items_container %}
  14.                 <div class="filter-panel-items-container">
  15.                     {% block component_filter_panel_items %}
  16.                         {% block component_filter_panel_item_manufacturer %}
  17.                             {# @var manufacturers \Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\Metric\EntityResult #}
  18.                             {% set manufacturers = listing.aggregations.get('manufacturer') %}
  19.                             {% if not manufacturers.entities is empty %}
  20.                                 {% set manufacturersSorted = manufacturers.entities|sort((a, b) => a.translated.name|lower <=> b.translated.name|lower) %}
  21.                                 {% sw_include '@Storefront/storefront/component/listing/filter/filter-multi-select.html.twig' with {
  22.                                     elements: manufacturersSorted,
  23.                                     sidebar: sidebar,
  24.                                     name: 'manufacturer',
  25.                                     displayName: 'listing.filterManufacturerDisplayName'|trans|sw_sanitize
  26.                                 } %}
  27.                             {% endif %}
  28.                         {% endblock %}
  29.                         {% block component_filter_panel_item_properties %}
  30.                             {# @var properties \Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\Metric\EntityResult #}
  31.                             {% set properties = listing.aggregations.get('properties') %}
  32.                             {% if not properties.entities is empty %}
  33.                                 {% for property in properties.entities %}
  34.                                     {% sw_include '@Storefront/storefront/component/listing/filter/filter-property-select.html.twig' with {
  35.                                         elements: property.options,
  36.                                         sidebar: sidebar,
  37.                                         name: 'properties',
  38.                                         displayName: property.translated.name,
  39.                                         displayType: property.displayType,
  40.                                         pluginSelector: 'filter-property-select',
  41.                                         propertyName: property.translated.name
  42.                                     } %}
  43.                                 {% endfor %}
  44.                             {% endif %}
  45.                         {% endblock %}
  46.                         {% block component_filter_panel_item_price %}
  47.                             {% set price = listing.aggregations.get('price') %}
  48.                             {% if price.min !== null and price.max !== null %}
  49.                                 {% sw_include '@Storefront/storefront/component/listing/filter/filter-range.html.twig' with {
  50.                                     sidebar: sidebar,
  51.                                     name: 'price',
  52.                                     minKey: 'min-price',
  53.                                     maxKey: 'max-price',
  54.                                     lowerBound: 0,
  55.                                     displayName: 'listing.filterPriceDisplayName'|trans|sw_sanitize,
  56.                                     minInputValue: 0,
  57.                                     maxInputValue: price.max,
  58.                                 } %}
  59.                             {% endif %}
  60.                         {% endblock %}
  61.                         {% block component_filter_panel_item_rating_select %}
  62.                             {% set rating = listing.aggregations.get('rating') %}
  63.                             {% if rating.max > 0 %}
  64.                                 {% sw_include '@Storefront/storefront/component/listing/filter/filter-rating-select.html.twig' with {
  65.                                     sidebar: sidebar,
  66.                                     name: 'rating',
  67.                                     pluginSelector: 'filter-rating-select',
  68.                                     displayName: 'listing.filterRatingDisplayName'|trans|sw_sanitize
  69.                                 } %}
  70.                             {% endif %}
  71.                         {% endblock %}
  72.                         {% block component_filter_panel_item_shipping_free %}
  73.                             {% set shippingFree = listing.aggregations.get('shipping-free') %}
  74.                             {% if shippingFree.max > 0 %}
  75.                                 {% sw_include '@Storefront/storefront/component/listing/filter/filter-boolean.html.twig' with {
  76.                                     name: 'shipping-free',
  77.                                     displayName: 'listing.filterFreeShippingDisplayName'|trans|sw_sanitize
  78.                                 } %}
  79.                             {% endif %}
  80.                         {% endblock %}
  81.                     {% endblock %}
  82.                 </div>
  83.             {% endblock %}
  84.             {% block component_filter_panel_active_container %}
  85.                 <div class="filter-panel-active-container">
  86.                     {% block component_filter_panel_active_container_inner %}{% endblock %}
  87.                 </div>
  88.             {% endblock %}
  89.         </div>
  90.      {% endblock %}
  91. {% endblock %}