How do I design my collection filters by product type? Not tags.

Tourist
8 1 0

Hello,
I currently using Debut Theme. I would like to make the collections could filterable by product types. However, it's allowing only filtering by tags.

 

{% for tag in collection.all_tags %}
                          {%- assign new_url = tag | link_to_tag: tag | split: 'href="' | last | split: '"' | first -%}
                          <option value="{{ new_url }}"{% if current_tags contains tag %} selected="selected"{% endif %}>{{ tag }}</option>
                        {% endfor %}
                      </select>
                      {% include 'icon-chevron-down' %}
                    </div>
                  </div>
                {% endunless %}
              {% endif %}

I know that I should change some parts of this code in the collection-template.liquid as product_type. But I couldn't find any way to do it.

 

Can anyone help me about this?

 

Best,

Ali

0 Likes