custom/plugins/WynCustomerTheme/src/Resources/views/storefront/component/sorting.html.twig line 1

Open in your IDE?
  1. {% set config = { sorting: current } %}
  2. {% set showSorting = (slot.config.showSorting.value is defined) ? slot.config.showSorting.value : true %}
  3. <div class="sorting-and-filter-child">
  4.   <wyn-button
  5.     variant="tertiary"
  6.     class="filter-button"
  7.     data-offcanvas-filter="true"
  8.     aria-haspopup="true"
  9.     aria-expanded="false"
  10.     aria-label="{{ "general.menuLink"|trans }}"
  11.   >
  12.     {% block element_product_listing_filter_button_icon %}
  13.       {% sw_icon 'filter' style { 'size': 'sm', 'slotAttr': 'icon' } %}
  14.     {% endblock %}
  15.     {{ "listing.filterTitleText"|trans }}
  16.   </wyn-button>
  17.   {% if showSorting and sortings|length > 1 %}
  18.     <wyn-select
  19.       class="sorting"
  20.       adjust-to-biggest-option
  21.       aria-label="{{ 'general.sortingLabel'|trans|striptags }}"
  22.       data-listing-sorting="true"
  23.       data-listing-sorting-options='{{ config|json_encode }}'
  24.     >
  25.       {% sw_icon 'sort' style { 'size': 'sm', 'slotAttr': 'icon' } %}
  26.       <div slot="label">{{ 'general.sortingLabel'|trans|striptags }}</div>
  27.       {% for sorting in sortings %}
  28.         {% set key = sorting.key %}
  29.         <wyn-option
  30.           value="{{ key }}"
  31.           {% if key == current %}selected{% endif %}
  32.         >
  33.           {{ sorting.translated.label|sw_sanitize }}
  34.         </wyn-option>
  35.       {% endfor %}
  36.     </wyn-select>
  37.   {% endif %}
  38. </div>