Using OR instead of AND with product tag filtering

Hi, everyone!

I have a question about product tag filtering. I’ve seen previous questions from a few years ago, but I wanted to see if there was a more recent answer. I want to include product filtering by tags on my collection page, but I want the tag logic to use OR instead of AND. Is there a way to achieve this using Liquid and if not, is there a jQuery / Javascript alternative that I would be able to utilize?

Just to give an example for my filtering needs. Let’s say I have a general collection page of “Men’s” and they want to filter “Jackets” and “Pants”. Currently if I attempt to filter, it’ll search for products that have both tags “Jackets” and “Pants”, which obviously no available products would show. Instead, I want it to filter any products that have either “Jackets” or “Pants” in tandem.

Let me know if you have any available solutions!

Thanks,

Travis

This is still not possible with Shopify’s built-in tag filtering. Most use an app for filtering that allows for this. The Product Filter & Search app works well, and the front-end is javascript based. They put the files in your theme so you can customize as needed.

Hello @StirTravis

Shopify native filtering is not dynamic and hasn’t handled “AND” condition yet. You can try Ultimate Filter & Search to filter by tag (prefix, manual tag selection) for multiple selection of the same type. It’s the most lightweight app that doesn’t clutter your theme with a lot of unnecessary codes.