custom/plugins/WynTheme/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
  4.   class="sorting-and-filter-child"
  5. >
  6. {# TODO class="btn btn-icon-extra-text filter-button"#}
  7.   <wyn-button
  8.     variant="secondary"
  9.     class="filter-button"
  10.     data-offcanvas-filter="true"
  11.     aria-haspopup="true"
  12.     aria-expanded="false"
  13.     aria-label="{{ "general.menuLink"|trans }}"
  14.   >
  15.     {% block element_product_listing_filter_button_icon %}
  16.       {% sw_icon 'filter' style { 'size': 'sm', 'slotAttr': 'icon' } %}
  17.     {% endblock %}
  18.     {{ "listing.filterTitleText"|trans }}
  19.   </wyn-button>
  20.   {% if showSorting and sortings|length > 1 %}
  21.     <wyn-select
  22.       class="sorting"
  23.       aria-label="{{ 'general.sortingLabel'|trans|striptags }}"
  24.       data-listing-sorting="true"
  25.       data-listing-sorting-options='{{ config|json_encode }}'
  26.     >
  27.       {% sw_icon 'sort' style { 'size': 'sm', 'slotAttr': 'icon' } %}
  28.       {% for sorting in sortings %}
  29.         {% set key = sorting.key %}
  30.         <wyn-option
  31.           value="{{ key }}"
  32.           {% if key == current %}selected{% endif %}
  33.         >
  34.           {{ sorting.translated.label|sw_sanitize }}
  35.         </wyn-option>
  36.       {% endfor %}
  37.     </wyn-select>
  38. {#    <div#}
  39. {#      class="select-wrapper select-wrapper--no-shadow select-wrapper--align-end"#}
  40. {#      data-listing-sorting="true"#}
  41. {#      data-listing-sorting-options='{{ config|json_encode }}'#}
  42. {#    >#}
  43. {#      TODO class="btn btn-icon-extra-text sort-button" #}
  44. {#      <wyn-button variant="secondary" class="sort-button">#}
  45. {#        {% sw_icon 'sort' style { 'size': 'sm', 'slotAttr': 'icon' } %}#}
  46. {#        <div class="btn__text">#}
  47. {#          {{ 'general.sortingLabel'|trans|striptags }}#}
  48. {#        </div>#}
  49. {#      </wyn-button>#}
  50. {#      <select#}
  51. {#        class="sorting custom-select form-control"#}
  52. {#        aria-label="{{ 'general.sortingLabel'|trans|striptags }}"#}
  53. {#        data-button-replacement=".sort-button"#}
  54. {#      >#}
  55. {#        {% for sorting in sortings %}#}
  56. {#          {% set key = sorting.key %}#}
  57. {#          <option#}
  58. {#            value="{{ key }}"#}
  59. {#            {% if key == current %}selected{% endif %}#}
  60. {#          >#}
  61. {#            {{ sorting.translated.label|sw_sanitize }}#}
  62. {#          </option>#}
  63. {#        {% endfor %}#}
  64. {#      </select>#}
  65. {#    </div>#}
  66.   {% endif %}
  67. </div>