AND and OR Conditions In Smart Collections

Topic summary

A user seeks to create sale collections combining different product types (OR logic) with compare-at-price conditions (AND logic), but Shopify’s native Smart Collections don’t support mixing AND/OR operators.

Suggested Workarounds:

  • Multiple Collections Approach: Create separate smart collections for each condition set, then manually combine products into a final collection
  • Tag-Based Method: Assign tags (e.g., “on-sale”, “shoes”) and build collections using tag conditions
  • Shopify Flow: For Plus users, automate tagging based on complex conditions, then create collections from those tags
  • Custom Code: Use Liquid to filter products dynamically in manual collections

Third-Party Solution:

A developer recommends their app “Smart Collections Pro,” which natively supports layered AND/OR condition groups and automatically updates product membership when conditions change. A free trial is available for testing.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

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.

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.

  1. 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.

  1. 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.

  1. 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 :blush:

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

Hey Aldain!

I hope you were able to find a way around your problem, but if you’re still looking for a solution, or for something simpler to manage , mixing AND and OR conditions in a smart collection is exactly what our app Smart Collections Pro does!

  1. Create a new managed collection in the app.

  2. Then you can add various layers of conditions using condition groups. Each layer being either “AND” or “OR”

  3. From here products move in/out of the collection every time the product is updated.

Full disclosure: I’m on the Smart Collections Pro dev team. We have a free trial if you’d like to test it on a few items first without impact on your existing collections
Hope that helps!