How to implement AND logic in native Shopify filter?

217 Views Asked by At

I using a native storefront filter by products tag in Shopify. shop_url/collection/collection_name?filter.p.tag=gold,diamond. But as result, I get products made of gold and products containing diamond (not only of gold). Therefore, I need the filter to work according to the logic AND and not OR. I tried use shop_url/collection/collection_name?filter.p.tag=gold+diamond and shop_url/collection/collection_name?filter.p.tag=gold&filter.p.tag=diamond but its didnt work.

As a result, I only want to get gold products that contain a diamond.

1

There are 1 best solutions below

0
Sean S. On

If you only use tags for filtering then you can use tag filtering instead of storefront filtering.

Like this:

shop_url/collection/collection_name/gold,diamond