How do I make the sidebar filter by multiple tags?

Currently, if you click a tag it filters products with that tag. If you hit a second tag it removes the original tag and goes to the new one. Changing this behavior is a simple switch:

First, navigate to the theme code editor and open  snippets/collections-sidebar.liquid

You will see this codeblock near the bottom of the file:

<li>
  {% comment %}
   Use link_to_add_tag if you want to allow filtering
   by multiple tags
  {% endcomment %}
  {{ tag | link_to_tag: tag }}
</li>

Simply follow the instructions in that comment:

From:

{{ tag | link_to_tag: tag }}

To:

{{ tag | link_to_add_tag: tag }}

That will allow your customers to filter by multiple tags. Clicking a tag again will remove it from the filters.

Still need help? Contact Us Contact Us