Hiding Collection Filter if there are no Tags in it

Highlighted
New Member
1 0 0

If there are no products with the tags under a collection filter, and the collection filter show up empty while viewing a specific collection:

https://www.screencast.com/t/xUNlDMuFW4h7

Is there a way to make the collection filter hidden (while viewing the collection that it has no products with the tags under)?

 

A guru helped me input this code, but it seems it just hides the collection filter if I don't have any tags listed for it in the theme options rather than if no products contain the tags:

    <section class="{%- if block.settings.filter_list == "" or block.settings.color_list == ""  -%}hide {% endif  %}filter filter--{{ block.type }} {% if filter_title_lower contains 'size' %}filter--size{% endif %} {% if filter_title_lower contains 'tag' %}filter--tag{% endif %} {% if filter_title_lower contains 'price' %}filter--price{% endif %}">

 

Thank you!

0 Likes
Highlighted
Tourist
4 0 1

I am also looking for a solution for this. Did you resolve it?

0 Likes