Liquid, JavaScript, themes, sales channels
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
Solved! Go to the solution
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.
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.
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.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024