custom/plugins/GrimmTheme/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. {% set device = app.session.get('deviceType') %}
  4. {% if showSorting and sortings|length > 1 %}
  5.     <div class="d-inline d-lg-inline" data-offcanvas-sorting-content="true">
  6.         <div class="sorting sorting-container__data">
  7.             <div class="d-inline" data-listing-sorting="true" data-listing-sorting-options='{{ config|json_encode }}'>
  8.                 <select class="sorting custom-select grm-light" aria-label="{{ 'general.sortingLabel'|trans|striptags }}">
  9.                     {% if device == 'mobile' or device == 'tablet' %}
  10.                         <option value="" disabled selected class="d-lg-none">{{ "listing.sort"|trans|sw_sanitize }}</option>
  11.                     {% endif %}
  12.                     {% for sorting in sortings %}
  13.                         {% set key = sorting.key %}
  14.                         <option value="{{ key }}"{% if key == current and device == 'desktop' %} selected{% endif %}>{{ sorting.translated.label|sw_sanitize }}</option>
  15.                     {% endfor %}
  16.                 </select>
  17.             </div> 
  18.         </div>
  19.     </div>
  20. {% endif %}