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

Open in your IDE?
  1. {% set filterItemId = 'filter-' ~ name ~ '-' ~ random() %}
  2. {% if filterRangeActiveMinLabel is not defined %}
  3.     {% set filterRangeActiveMinLabel = 'listing.filterRangeActiveMinLabel'|trans({'%displayName%': displayName})|sw_sanitize %}
  4. {% endif %}
  5. {% if filterRangeActiveMaxLabel is not defined %}
  6.     {% set filterRangeActiveMaxLabel = 'listing.filterRangeActiveMaxLabel'|trans({'%displayName%': displayName})|sw_sanitize %}
  7. {% endif %}
  8. {% if filterRangeErrorMessage is not defined %}
  9.     {% set filterRangeErrorMessage = 'listing.filterRangeErrorMessage'|trans|sw_sanitize %}
  10. {% endif %}
  11. {% if filterRangeLowerBoundErrorMessage is not defined %}
  12.     {% set filterRangeLowerBoundErrorMessage = 'listing.filterRangeLowerBoundErrorMessage'|trans({'%lowerBound%': lowerBound})|sw_sanitize %}
  13. {% endif %}
  14. {% if minKey is not defined %}
  15.     {% set minKey = 'min-price' %}
  16. {% endif %}
  17. {% if maxKey is not defined %}
  18.     {% set minKey = 'max-price' %}
  19. {% endif %}
  20. {% if unit is not defined %}
  21.     {% set unit = page.header.activeCurrency.symbol %}
  22. {% endif %}
  23. {# @deprecated tag:v6.5.0 - `currencySymbol` will be removed use `unit` instead #}
  24. {% if currencySymbol is defined %}
  25.     {% set unit = currencySymbol %}
  26. {% endif %}
  27. {% if minInputValue is not defined %}
  28.     {% set minInputValue = 0 %}
  29. {% endif %}
  30. {% if maxInputValue is not defined %}
  31.     {# @deprecated tag:v6.5.0 - use maxInputValue instead of price #}
  32.     {% set maxInputValue = price.max %}
  33. {% endif %}
  34. {% set filterRangeOptions = {
  35.     name,
  36.     minKey,
  37.     maxKey,
  38.     lowerBound,
  39.     unit,
  40.     currencySymbol,
  41.     snippets: {
  42.         filterRangeActiveMinLabel,
  43.         filterRangeActiveMaxLabel,
  44.         filterRangeErrorMessage,
  45.         filterRangeLowerBoundErrorMessage
  46.     }
  47. } %}
  48. {% block component_filter_range %}
  49.     <div class="filter-range filter-panel-item{% if not sidebar %} dropdown{% endif %}"
  50.          data-filter-range="true"
  51.          data-filter-range-options='{{ filterRangeOptions|json_encode }}'>
  52.         {% block component_filter_range_toggle %}
  53.             <button class="filter-panel-item-toggle btn{% if sidebar %} btn-block{% endif %}"
  54.                     aria-expanded="false"
  55.                     {% if sidebar %}
  56.                     data-toggle="collapse"
  57.                     data-target="#{{ filterItemId }}"
  58.                     {% else %}
  59.                     data-toggle="dropdown"
  60.                     data-boundary="viewport"
  61.                     data-offset="0,8"
  62.                     aria-haspopup="true"
  63.                     {% endif %}>
  64.                 {% block component_filter_range_display_name %}
  65.                     {{ displayName }}
  66.                 {% endblock %}
  67.                 {% block component_filter_range_toggle_icon %}
  68.                     {% sw_icon 'arrow-medium-down' style {'pack': 'solid', 'size': 'xs', 'class': 'filter-panel-item-toggle'} %}
  69.                 {% endblock %}
  70.             </button>
  71.         {% endblock %}
  72.         {% block component_filter_range_dropdown %}
  73.             <div class="filter-range-dropdown filter-panel-item-dropdown{% if sidebar %} collapse{% else %} dropdown-menu{% endif %}"
  74.                  id="{{ filterItemId }}">
  75.                 {% block component_filter_range_container %}
  76.                     <div class="filter-range-container">
  77.                         {% block component_filter_range_min %}
  78.                             <label class="filter-range-min">
  79.                                 {% block component_filter_range_min_label %}
  80.                                     {{ 'listing.filterRangeMinLabel'|trans|sw_sanitize }}
  81.                                 {% endblock %}
  82.                                 {% block component_filter_range_min_input %}
  83.                                     <input class="form-control min-input"
  84.                                            type="number"
  85.                                            name="{{ minKey }}"
  86.                                            min="{{ minInputValue }}"
  87.                                            max="{{ maxInputValue }}">
  88.                                 {% endblock %}
  89.                                 {% block component_filter_range_min_unit %}
  90.                                     {% block component_filter_range_min_currency_symbol %}
  91.                                         {% deprecated '@deprecated tag:v6.5.0 - The block `component_filter_range_min_currency_symbol` will be renamed, use block `component_filter_range_min_unit` instead' %}
  92.                                         {# @deprecated tag:v6.5.0 - `filter-range-currency-symbol` will be removed, use `filter-range-unit` instead #}
  93.                                         <span class="filter-range-unit filter-range-currency-symbol">
  94.                                             {{ unit }}
  95.                                         </span>
  96.                                     {% endblock %}
  97.                                 {% endblock %}
  98.                             </label>
  99.                         {% endblock %}
  100.                         {% block component_filter_range_divider %}
  101.                             <div class="filter-range-divider">
  102.                                 &ndash;
  103.                             </div>
  104.                         {% endblock %}
  105.                         {% block component_filter_range_max %}
  106.                             <label class="filter-range-max">
  107.                                 {% block component_filter_range_max_label %}
  108.                                     {{ 'listing.filterRangeMaxLabel'|trans|sw_sanitize }}
  109.                                 {% endblock %}
  110.                                 {% block component_filter_range_max_input %}
  111.                                     <input class="form-control max-input"
  112.                                            type="number"
  113.                                            name="{{ maxKey }}"
  114.                                            min="{{ minInputValue }}"
  115.                                            max="{{ maxInputValue }}">
  116.                                 {% endblock %}
  117.                                 {% block component_filter_range_max_unit %}
  118.                                     {% block component_filter_range_max_currency_symbol %}
  119.                                         {% deprecated '@deprecated tag:v6.5.0 - The block `component_filter_range_min_currency_symbol` will be renamed, use block `component_filter_range_min_unit` instead' %}
  120.                                         {# @deprecated tag:v6.5.0 - `filter-range-currency-symbol` will be removed, use `filter-range-unit` instead #}
  121.                                         <span class="filter-range-unit filter-range-currency-symbol">
  122.                                             {{ unit }}
  123.                                         </span>
  124.                                     {% endblock %}
  125.                                 {% endblock %}
  126.                             </label>
  127.                         {% endblock %}
  128.                     </div>
  129.                 {% endblock %}
  130.             </div>
  131.         {% endblock %}
  132.     </div>
  133. {% endblock %}