Hey there,
I’m using a third-party theme, and the theme has tag filtering feature in the collection page which is great. But the problem is: it doesn’t hide unavailable tags and shows all the tags that I put in on every collection whether they are available or not. I found this ‘‘sidebar-tag-filter.liquid’’ in the ‘‘Sections’’ and I tried to fix it by myself but I couldn’t.
I would appreciate it a lot if someone could help me with that.
Here is the code:
{% if section.blocks.size > 0 %}
{% for block in section.blocks %}
{% if block.settings.enable_shop_by_tags %}
{% if block.settings.shop_by_tags_title != blank %}
{% assign tags = block.settings.shop_by_tags_list | split: ',' %}
####
{{ block.settings.shop_by_tags_title }}
{% assign counter = 0 %}
{% for t in tags %}
{% assign tag = t | strip %}
{% assign tag_value = tag | handleize %}
{% if current_tags contains tag %}
-
{% else %}
-
{% assign counter = counter | plus:1 %}
{% endif %}
{% endfor %}
{% if counter == 0 %}{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% schema %}
{
"name": "Tags",
"max_blocks": 20,
"settings": [
{
"type": "checkbox",
"id": "enable_sidebar_multiple_choice",
"label": "Multiple choices",
"default": true,
"info": "User can select multiple colors (size, brand...) or only one color (size, brand...)?"
}
],
"blocks": [
{
"type": "text",
"name": "Tags",
"settings": [
{
"type": "checkbox",
"id": "enable_shop_by_tags",
"label": "Enable",
"default": true
},
{
"type": "text",
"id": "shop_by_tags_title",
"label": "Shop by tags",
"default": "Shop By Size",
"info": "i.e \"Shop by Size\"."
},
{
"type": "textarea",
"id": "shop_by_tags_list",
"label": "Tags list",
"info": "Separate by a comma, i.e \"XS, S, M, L, XL\"."
}
]
}
]
}
{% endschema %}