AND and OR Conditions In Smart Collections

AND and OR Conditions In Smart Collections

aldain
Visitor
2 0 0

Is there a way to have AND and OR Conditions for Shopify Collections? It's strange that this feature is not available for Smart Collections. 

 

I'm trying to create Sale Collections that have products that use different 'Type' conditions while also having 'Compare-at-price' conditions. 

Replies 2 (2)

goldi07
Trailblazer
166 13 18

Hello @aldain 

Shopify’s Smart Collections (Automated Collections) only allow all conditions (AND) or any condition (OR), but not a mix of both (AND + OR together). However, you can work around this limitation using these methods:

1. Use Multiple Smart Collections (Workaround)
Since Shopify doesn’t support AND/OR combinations within a single smart collection, you can stack collections to achieve this effect:

Step 1: Create multiple Smart Collections for each OR condition separately.

Step 2: Create a new Manual Collection that includes all the products from the previous Smart Collections.

For example:

.Smart Collection 1 (OR Condition):

.Product Type = "Shoes"

.OR Product Type = "Bags"

Smart Collection 2 (AND Condition):

.Compare-at-price > 0 (Sale items)

.Final Collection (Manual):

.Add all products from Smart Collection 1 and Smart Collection 2.

This way, products that match either condition set will be included.

 

2. Use Tags for More Control
Another method is to use product tags to simulate AND/OR conditions:

.Assign tags like on-sale, shoes, bags, etc.

.Then create a Smart Collection with ANY condition (OR logic) for these tags.

This approach lets you manage conditions flexibly by assigning tags manually or via bulk updates.

 

3. Use Shopify Flow (For Shopify Plus)
If you're on Shopify Plus, you can automate tagging using Shopify Flow:

.Create a workflow to add a tag when conditions are met (e.g., Type = Shoes AND Compare-at-price > 0).

.Then create a Smart Collection based on that tag.

 

4. Custom Code (For Advanced Users)
If you're comfortable with Liquid, you can use a manual collection and modify the theme code to filter products dynamically using AND/OR logic.

 

Thank you 😊

 

 

Was I helpful?

Buy me a coffee



Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -Goldi184507@gmail.com - Skype: live:.cid.819bad8ddb52736c -Whatsapp: +919317950519
Checkout Some Free Sections Here
aldain
Visitor
2 0 0

Thanks for the reply Goldi – I'll give this a try!