Display the active collection's product type and all the product types of all products

fotiskaima
Tourist
15 0 3

Hello,

Can you tell me how to appear at the filter bar only the available product types at the active collection?

The code is this for my site

 

{%- if settings.shop_by_type_enable and shop.types.size > 0 -%}
<div id="shopbytype">
  {%- if settings.shop_by_type_title != blank -%}
  <h5 class="title_block" data-toggle="collapse" data-target="#ul_catalog_type" aria-expanded="{% if settings.shop_by_type_collapse %}true{% else %}false{% endif %}">
    {{ settings.shop_by_type_title }}
  </h5>
  {%- endif -%}
  <div class="block_content ">
    <ul id="ul_catalog_type" class="mt-4 collapse list-unstyled {% if settings.shop_by_type_collapse %}show{% endif %}">
      {%- if settings.shop_by_type_custom_list != blank -%}
      {%- assign items = settings.shop_by_type_custom_list | split:"," | strip -%}
      {%- for type in shop.types limit:settings.shop_by_type_number -%}
      {%- if type != blank -%}
      {%- if items contains type -%}
      <li {% if collection.current_type == type %}class="active"{% endif %}>
        {{ type | link_to_type }}
      </li>
      {%- endif -%}
      {%- endif -%}
      {%- endfor -%}
      {%- else -%}
      {%- for type in shop.types limit:settings.shop_by_type_number -%}
      {%- if type != blank -%}
      <li {% if collection.current_type == type %}class="active" {% endif %}>
        {{ type | link_to_type }}
      </li>
      {%- endif -%}
      {%- endfor -%}
      {%- endif -%}
    </ul>
  </div>
</div>
{%- endif -%}

 

Replies 0 (0)