Solved

Using OR instead of AND with product tag filtering

StirTravis
Visitor
2 0 0

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

Accepted Solution (1)

Nancy_Drake
Shopify Partner
176 9 19

This is an accepted solution.

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.

 

AI Search & Product Filter | SB - Check out our Shopify search and filter app to drive more sales

View solution in original post

Replies 2 (2)

gina-gregory
Shopify Expert
742 51 211

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.

Nancy_Drake
Shopify Partner
176 9 19

This is an accepted solution.

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.

 

AI Search & Product Filter | SB - Check out our Shopify search and filter app to drive more sales