Shopify themes, liquid, logos, and UX
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 %}
<aside class="sidebar-tag filter tags {{ block.settings.shop_by_tags_title | downcase }} {{forloop.index}}">
{% assign tags = block.settings.shop_by_tags_list | split: ',' %}
<div class="widget">
<h4>
<span>{{ block.settings.shop_by_tags_title }} </span>
<a href="javascript:void(0)" class="clear" style="display:none">
<i class="zmdi zmdi-close"></i>
</a>
</h4>
<div class="widget-content">
<ul>
{% assign counter = 0 %}
{% for t in tags %}
{% assign tag = t | strip %}
{% assign tag_value = tag | handleize %}
{% if current_tags contains tag %}
<li>
<i></i>
<input type="checkbox" value="{{ tag_value }}" checked/>
<label>{{ tag }}</label>
</li>
{% else %}
<li>
<i></i>
<input type="checkbox" value="{{ tag_value }}"/>
<label>{{ tag }}</label>
</li>
{% assign counter = counter | plus:1 %}
{% endif %}
{% endfor %}
{% if counter == 0 %}<script>$('.sidebar-tag.{{forloop.index}}').hide();</script>{% endif %}
</ul>
</div>
</div>
</aside>
{% 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 %}
Hello, @TimmyTips
Welcome to the Shopify community!
and Thanks for your Good question.
Please share your site URL,
So I will check and provide a solution here.
Hey @KetanKumar,
Thank you so much for reaching out! Here is my website: buytilestone.com
Thanks for store url
if possible to let me know which one did you hide?
Thank you @KetanKumar. I didn't hide anything. I want the unavailable tags to be hidden.
For example, let's take a look at ''Shop By Finish'' filter: We don't have any ''Polished'' or ''Honed'' finished product in Pavers collection. So, I don't want these tags to be seen in Pavers. But every tag that I put in is seen in every collection whether they are available or not. That's the problem.
Thanks
ok do you need if the product sold out doesn't show filter right? if yes so i can be done some customization take more time
No. I need something like: “if the tag filter is not applicable to the collection, don’t show the tag filter”
Ok
Thanks for clearing maybe some custom code and testing on the backend side
Thanks for update can you please send me PM
@Logan102
oh sorry for that issue can you please share store url so i will check and let you know
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025