How to Organize Shopify Product Collections using AND, OR Logic

Shopify collections help organize your products, making it easier for customers to browse and for you to manage inventory. However, Shopify’s built-in smart collections have a limitation—they don’t support AND/OR logic for filtering products.

In this tutorial, we’ll show you a workaround using an automation workflow. By tagging products based on specific conditions—like product type or keywords in the title—you can create smarter collections that automatically update as your inventory changes. For example, you can tag a product if it’s a towel OR if its title contains “soap”, then use Shopify’s collection system to group those tagged products.

Let’s dive in and set up this automation step by step!

Get MESA today to automate Shopify collections using AND, OR logic

Step-by-step guide: How to use AND, OR logic to organize Shopify smart collections

Time needed: 5 minutes

This workflow automates the tagging of products in Shopify based on specific criteria. It listens for product updates, checks if they meet AND, OR conditions, and applies a tag if they do. Then, we’ll setup a smart collection using those tagged products.

  1. Monitor product updates

    The workflow begins by monitoring product updates in Shopify. Whenever a product is updated, this step triggers the workflow to evaluate the product’s details. 

  2. Filter using AND, OR logic

    Since Shopify’s smart collection logic doesn’t support AND, OR logic, this step checks if the product meets specific conditions using the built-in tool, Filter. It verifies if the product type equals “towel” or, if the product title contains the word “soap.” Filter using AND, OR logic

  3. Add product tag

    Then, the workflow adds a tag to the product. The tag “towels or soap” helps categorize the product based on the established criteria. Add product tag

  4. Turn “On” this workflow

    Be sure to run your workflow once to test whether it tags the right products. Then, turn “On” this workflow to have it run whenever products are updated.Turn "On" this workflow

  5. Setup a smart collection in Shopify

    Create a new smart collection in Shopify. Using the fields provided, add the tags defined in your workflow to add those items to this collection automatically. Setup a smart collection in Shopify

Why organize products into collections?

Adding products to collections has many benefits for your Shopify store. First and foremost, it boosts sales through better product discovery. When customers can navigate through well-defined categories, they are more likely to find what they’re looking for and buy.

Collections also simplify inventory management by allowing you to show or hide products based on stock levels. This means customers only see available products, no more disappointment or backorders.

Plus, collections enable you to create targeted promotions and seasonal displays. By grouping products together, you can promote specific ranges or offer discounts on related items. This strategic approach can drive sales and clear out seasonal inventory.

Finally, a “New Arrivals” collection is a great way to showcase new inventory and keep your store looking fresh. By regularly updating this collection, you can encourage customers to come back and check out the latest products.

Types of Shopify collections

Shopify has two ways to organize your products into collections: manual and smart.

Manual Collections

With manual collections, you have the flexibility to curate products and add them to a collection one by one. This hands-on approach gives you complete control over the products in each collection and the order in which they are displayed. Manual collections are perfect for handpicked selections like “Editor’s Favorites” or “Seasonal Highlights,” where you want to highlight specific products based on your own criteria.

Manual collections offer a high level of precision and customization but can become time-consuming to maintain, especially for large product catalogs. As your inventory grows, you may find smart collections are a more efficient solution.

Smart Collections

Smart collections use automation to populate based on predefined criteria and rules. Instead of manually adding products, you set the parameters using product attributes like title, type, vendor, price range, or custom tags. Shopify then adds or removes products from the collection as they meet or don’t meet those conditions. 

Here’s an example: you can create a smart collection called “Winter Accessories” that includes all products with both “winter” and “accessories” tags. As you add more winter accessories, they will automatically show up in this collection without you having to do anything.

Adding AND, OR logic to Shopify collections

By using conditions with AND and OR operators, you can create super-focused collections that exactly match your product attributes.

Let’s say you want to create a “New Bathroom Essentials” collection that shows products with the “new” tag AND are in the “bathroom” product type OR have “essential” in the title. To do this, you would create your smart collection conditions as follows:

  • Product tag contains “new”
  • AND
  • (Product type is equal to “bathroom” OR Product title contains “essential”)

To get around Shopify’s smart collection limitations, you can use a tagging methodology that combines multiple attributes into one tag. For example, create a “bathroom-essential” tag and assign it to products that are in the “bathroom” product type and have “essential” in the title. This simplifies your smart collection conditions to:

  • Product tag contains “new”
  • AND
  • Product tag contains “bathroom-essential”

Another advantage of using AND and OR logic in your smart collections is creating mutually exclusive collections. For example, you can create a “Clearance Items” collection that includes products with a price less than $25 OR a comparison at a price greater than $50. This means products with deeply discounted or significant price reductions will automatically appear in the collection.

Frequently asked questions

Can products be in multiple collections?

Yes! A single product can be part of multiple collections. For example, a black leather jacket can belong to: “Best Sellers” (for popular items), “Winter Collection” (seasonal grouping), “Men’s Jackets” (product category)

How often should I update collections?

Regular updates keep collections relevant. For instance, a “New Arrivals” collection should be refreshed weekly or monthly, while a “Holiday Sale” collection should be updated before each shopping season.

What’s the difference between manual and smart collections?

Manual collections require adding products individually—ideal for curated selections like “Staff Picks.” Automated collections use rules—perfect for dynamic groups like “All Items Over $50.”

What’s the best way to handle seasonal collections?

Create and schedule collections in advance. For example, a “Back to School” collection can be built in July and set to go live in early August, ensuring timely promotion.

What you should do now

Whenever you’re ready…here are 4 ways MESA can help you get more done:

  1. Sign up for MESA. The best way to get started is sign up for MESA today. Every plan includes the first 7-days free so you can be assured your workflow is running properly.
  2. Browse pre-made templates. Our customizable workflow templates are a great way to get started more quickly.
  3. Talk to our automation experts. If you need help personalizing any workflow template, guidance how to make any automation or, simply want us to make your workflow, we can help.
  4. If you know another merchant who’d enjoy reading this page, share it with them via LinkedIn, YouTube, Twitter, or Facebook.

Accelerate your work with AI automation.

Try for free
background: abstract lines

Accelerate your work with AI automation.

Build AI agents in minutes that integrate, automate, and simplify your business.

Try MESA for free, 7-day trial included.