vendor/store.shopware.com/acrisfiltercs/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_items_container %}
  3.     {% if listing.extensions.acrisFilter.sortedFilters %}
  4.         {% set sortedFilters = listing.extensions.acrisFilter.sortedFilters %}
  5.         {% set hidedValue = false %}
  6.         {% for filter in sortedFilters %}
  7.             {% if filter.hide == true %}
  8.                 {% if filter.identifier == 'price' %}
  9.                     {% set price = listing.aggregations.get('price') %}
  10.                     {% if price.min > 0 and price.max > 0 %}
  11.                         {% set hidedValue = true %}
  12.                     {% endif %}
  13.                 {% elseif filter.identifier == 'manufacturer' %}
  14.                     {% set manufacturers = listing.aggregations.get('manufacturer') %}
  15.                     {% if not manufacturers.entities is empty %}
  16.                         {% set hidedValue = true %}
  17.                     {% endif %}
  18.                 {% elseif filter.identifier == 'rating' %}
  19.                     {% set rating = listing.aggregations.get('rating') %}
  20.                     {% if not rating is empty %}
  21.                         {% set hidedValue = true %}
  22.                     {% endif %}
  23.                 {% elseif filter.identifier == 'shipping-free' %}
  24.                     {% set shippingFree = listing.aggregations.get('shipping-free') %}
  25.                     {% if shippingFree.max > 0 %}
  26.                         {% set hidedValue = true %}
  27.                     {% endif %}
  28.                 {% elseif filter.identifier == 'categories' %}
  29.                     {# @var categories \Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\Metric\EntityResult #}
  30.                     {% set categories = listing.aggregations.get('categories').extensions.acrisCategoryFilterAggregationTree.tree %}
  31.                     {% if categories is not empty %}
  32.                         {% set hidedValue = true %}
  33.                     {% endif %}
  34.                 {% else %}
  35.                     {% set hidedValue = true %}
  36.                 {% endif %}
  37.             {% endif %}
  38.             {% if filter.identifier == 'properties' %}
  39.                 {# @var properties \Shopware\Core\Framework\DataAbstractionLayer\Search\AggregationResult\Metric\EntityResult #}
  40.                 {% set properties = listing.aggregations.get('properties') %}
  41.                 {% if properties.entities is not empty %}
  42.                     {% for property in properties.entities %}
  43.                         {% if property.translated.customFields.acris_filter_hide == true %}
  44.                             {% set hidedValue = true %}
  45.                         {% endif %}
  46.                     {% endfor %}
  47.                 {% endif %}
  48.             {% endif %}
  49.         {% endfor %}
  50.         {% block acris_filter_hidden_filters_loop %}
  51.             {% set randomIdForFilter = random(0,1000) %}
  52.             <div class="filter-panel-items-container{% if sidebar == false %} acris-filter-inline{% endif %} {% if config('AcrisFilterCS.config.disableFilterOptions') == 'hide' %} acris-hide-disabled-filters{% endif %}">
  53.                 {% for filter in sortedFilters %}
  54.                     {% if filter.identifier == 'properties' %}
  55.                         {% set properties = listing.aggregations.get('properties') %}
  56.                         {% if properties.entities is not empty %}
  57.                             {% for property in properties.entities %}
  58.                                 {% if property.translated.customFields.acris_filter_hide != true %}
  59.                                     {% sw_include '@AcrisFilterCS/storefront/component/acris-filter-listing/acris-filter-listing.html.twig' with {
  60.                                         propertyID: property.id
  61.                                     } %}
  62.                                 {% endif %}
  63.                             {% endfor %}
  64.                         {% endif %}
  65.                     {% else %}
  66.                         {% if filter.hide != true %}
  67.                             {% sw_include '@AcrisFilterCS/storefront/component/acris-filter-listing/acris-filter-listing.html.twig' %}
  68.                         {% endif %}
  69.                     {% endif %}
  70.                 {% endfor %}
  71.                 <div
  72.                     class="collapse filter-panel-items-container{% if sidebar == false %} acris-filter-inline{% endif %}"
  73.                     id="filterCollapsed-{{ randomIdForFilter }}">
  74.                     {% for filter in sortedFilters %}
  75.                         {% if filter.identifier == 'properties' %}
  76.                             {% set properties = listing.aggregations.get('properties') %}
  77.                             {% if properties.entities is not empty %}
  78.                                 {% for property in properties.entities %}
  79.                                     {% if property.translated.customFields.acris_filter_hide == true %}
  80.                                         {% sw_include '@AcrisFilterCS/storefront/component/acris-filter-listing/acris-filter-listing.html.twig' with {
  81.                                             propertyID: property.id
  82.                                         } %}
  83.                                     {% endif %}
  84.                                 {% endfor %}
  85.                             {% endif %}
  86.                         {% else %}
  87.                             {% if filter.hide == true %}
  88.                                 {% sw_include '@AcrisFilterCS/storefront/component/acris-filter-listing/acris-filter-listing.html.twig' %}
  89.                             {% endif %}
  90.                         {% endif %}
  91.                     {% endfor %}
  92.                 </div>
  93.                 {% if hidedValue == true %}
  94.                     <div class="filter-multi-select filter-multi-select-manufacturer filter-panel-item dropdown">
  95.                         {% block page_product_detail_acris_supplies_upselling_article_button %}
  96.                             <button id="btnShowItems"
  97.                                     class="{% if sidebar == false %}filter-panel-item-toggle btn collapsed{% else %}btn btn-block collapsed{% endif %}"
  98.                                     type="button"
  99.                                     data-toggle="collapse"
  100.                                     data-target="#filterCollapsed-{{ randomIdForFilter }}"
  101.                                     aria-expanded="true"
  102.                                     aria-controls="filterCollapsed-{{ randomIdForFilter }}"
  103.                                     title="{{ "acrisFilter.buttonFilterShowHideLabel"|trans|striptags }}"
  104.                                     aria-label="{{ "acrisFilter.buttonFilterShowHideLabel"|trans|striptags }}">
  105.                             <span class="if-collapsed">
  106.                                 {{ "acrisFilter.buttonFiltersShow"|trans|sw_sanitize }}
  107.                                 {% sw_icon 'arrow-medium-down' style {'pack': 'solid', 'size': 'xs', 'class': 'filter-panel-item-toggle'} %}
  108.                             </span>
  109.                                 <span class="if-not-collapsed">
  110.                                 {{ "acrisFilter.buttonFiltersHide"|trans|sw_sanitize }}
  111.                                     {% sw_icon 'arrow-medium-up' style {'pack': 'solid', 'size': 'xs', 'class': 'filter-panel-item-toggle'} %}
  112.                             </span>
  113.                             </button>
  114.                         {% endblock %}
  115.                     </div>
  116.                 {% endif %}
  117.             </div>
  118.         {% endblock %}
  119.     {% else %}
  120.         {{ parent() }}
  121.     {% endif %}
  122. {% endblock %}
  123.  {% block component_filter_panel_active_container %}
  124.      {% if config('AcrisFilterCS.config.showActiveFilter') %}
  125.          <div class="filter-panel-active-container"></div>
  126.      {% else %}
  127.          {{ parent() }}
  128.      {% endif %}
  129.  {% endblock %}