templates/product/filters/select_category.html.twig line 1

Open in your IDE?
  1. {%  set data = app_category_filter_prepare_data(currentValue, rootCategory) %}
  2. <div class="filter categories pb-3">
  3.     <h6 class="mb-0">{{ ('general.filter.' ~ label) |lower|trans }}</h6>
  4.     <div class="list-group">
  5.         {% for parentCategory in data.parentCategories %}
  6.             <a href="{{ app_category_filter_generate_link(parentCategory, rootCategory, true)  }}" class="list-group-item list-group-item-action">
  7.                 <i class="fas fa-angle-left"></i>
  8.                 {{ parentCategory.name }}
  9.             </a>
  10.         {% endfor %}
  11.         <!-- current category -->
  12.         {%  if(data.currentCategory) %}
  13.             <input type="hidden" name="parentCategoryIds" value="{{ data.currentCategory.id }}" />
  14.             <span class="list-group-item list-group-item-secondary d-flex justify-content-between align-items-center">
  15.                 <strong>{{ data.currentCategory.name }}</strong>
  16.                 {%  if(indexedValues[data.currentCategory.id]) is defined %}
  17.                     <span class="badge badge-primary badge-pill">{{  indexedValues[data.currentCategory.id]['count']  }}</span>
  18.                 {% endif %}
  19.             </span>
  20.         {%  endif %}
  21.         {% for subCategory in data.subCategories %}
  22.             <a href="{{ app_category_filter_generate_link(subCategory, rootCategory, true)  }}" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
  23.                 <span>
  24.                     <i class="fas fa-angle-right"></i>
  25.                     {{ subCategory.name }}
  26.                 </span>
  27.                 {%  if(indexedValues[subCategory.id]) is defined %}
  28.                     <span class="badge badge-primary badge-pill">{{ indexedValues[subCategory.id]['count']  }}</span>
  29.                 {% endif %}
  30.             </a>
  31.         {% endfor %}
  32.     </div>
  33. </div>