custom/plugins/MoorlFoundation/src/Resources/views/storefront/component/listing/filter-panel.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/listing/filter-panel.html.twig' %}
  2. {% block component_filter_panel_item_manufacturer %}
  3.     {% if listing.aggregations %}
  4.         {% set countries = listing.aggregations.get('country') %}
  5.         {% if countries and not countries.entities is empty %}
  6.             {% set countriesSorted = countries.entities|sort((a, b) => a.translated.name|lower > b.translated.name|lower) %}
  7.             {% sw_include '@Storefront/storefront/component/listing/filter/filter-multi-select.html.twig' with {
  8.                 elements: countriesSorted,
  9.                 sidebar: sidebar,
  10.                 name: 'country',
  11.                 displayName: 'moorl-foundation.listing.filter.country'|trans
  12.             } %}
  13.         {% endif %}
  14.         {% set tags = listing.aggregations.get('tag') %}
  15.         {% if tags and not tags.entities is empty %}
  16.             {% set tagsSorted = tags.entities|sort((a, b) => a.name|lower <=> b.name|lower) %}
  17.             {% sw_include '@Storefront/storefront/component/listing/filter/filter-multi-select.html.twig' with {
  18.                 elements: tagsSorted,
  19.                 sidebar: sidebar,
  20.                 name: 'tag',
  21.                 displayName: 'moorl-foundation.listing.filter.tags'|trans
  22.             } %}
  23.         {% endif %}
  24.         {% set firstChar = listing.aggregations.get('first-char') %}
  25.         {% if firstChar and not firstChar.entities is empty %}
  26.             {% set firstChars = [] %}
  27.             {% for singleChar in 'A'..'Z' %}
  28.                 {% set firstChars = firstChars|merge([{
  29.                     name: singleChar,
  30.                     id: singleChar,
  31.                     translated: {
  32.                         name: singleChar
  33.                     }
  34.                 }]) %}
  35.             {% endfor %}
  36.             {% sw_include '@Storefront/storefront/component/listing/filter/filter-property-select.html.twig' with {
  37.                 elements: firstChars,
  38.                 sidebar: sidebar,
  39.                 name: 'first-char',
  40.                 displayName: 'moorl-foundation.listing.filter.firstChar'|trans
  41.             } %}
  42.         {% endif %}
  43.     {% endif %}
  44.     {{ parent() }}
  45. {% endblock %}