# Shopify Collection Rules Engine: Understanding Automated Logic Canonical: https://awsmcollections.com/automation-efficiency/shopify-collection-rules-engine Shopify's collection rules engine powers automated [collections](https://awsmcollections.com/glossary/what-is-a-shopify-collection-and-how-does-it-work) by evaluating products against conditions you define. This guide explains how the rules engine works and how to use it effectively. ## How the Rules Engine Works The rules engine operates through a simple process: - You define conditions for product inclusion - The engine evaluates each product against these conditions - Matching products are automatically added to the collection - Products are re-evaluated when their attributes change ## Rule Components ### Attributes Product data that can be evaluated: - Product title - Product type - Vendor - [Product tag](https://awsmcollections.com/glossary/what-are-shopify-tags-and-how-to-use-them-effectively) - Price / Compare at price - Inventory stock - Weight - Variant title ### Operators How values are compared: - **Equals:** Exact match required - **Not equals:** Excludes matching values - **Contains:** Partial text match - **Starts with / Ends with:** Position-based text match - **Greater than / Less than:** Numeric comparisons ### Values The target data to match against: - Text strings for title, type, vendor, tag - Numbers for price, inventory, weight **Extended Rules Engine:** [AWSM Collections](https://awsmcollections.com/) provides an enhanced rules engine with additional operators, complex condition combinations, and scheduling capabilities. ## Logic Operations ### AND Logic (All Conditions) Select "Products must match **all conditions**" — products must satisfy every rule to be included: - Creates precise, targeted collections - Example: Type = "Shirts" AND Price > 50 — only shirts above $50 appear - Each additional AND condition narrows the results further ### OR Logic (Any Condition) Select "Products must match **any condition**" — products matching at least one rule are included: - Creates broader collections - Example: Tag = "featured" OR Tag = "popular" — products with either tag appear - Each additional OR condition expands the results **Limitation:** Shopify doesn't support mixing AND and OR logic in a single collection — you cannot create "Type = Shoes AND (Tag = red OR Tag = blue)" natively. Workarounds include using combined tags (e.g., `shoes_red`, `shoes_blue`) or third-party apps like [AWSM Collections](https://awsmcollections.com/) that support grouped conditions. ## Rule Evaluation Timing The rules engine evaluates products: - When a new product is created - When product attributes are updated - When collection rules are modified - When products are imported via CSV ## Designing Effective Rules - Start with simple, clear conditions - Use consistent product data for reliable matching - Test rules with known products - Avoid overly complex rule combinations - Document your rule logic for team reference ## Common Rule Patterns - **Sale items:** Compare at price > 0 - **In stock:** Inventory stock > 0 - **Brand pages:** Vendor = "Brand Name" - **Category pages:** Product type = "Category" - **Tagged items:** Tag = "specific-tag" ## Troubleshooting Rules - **Products not appearing:** Check attribute values match exactly - **Too many products:** Use AND logic with more conditions - **Unexpected products:** Review OR vs AND logic ## Conclusion Understanding Shopify's collection rules engine helps you create more effective automated collections. Focus on clear conditions, consistent product data, and simple rule structures for reliable automation. ## Related Resources - [Shopify Help: Collections](https://help.shopify.com/en/manual/products/collections) - [What is a Shopify Collection?](https://awsmcollections.com/glossary/what-is-a-shopify-collection-and-how-does-it-work) - [Using Tags Effectively](https://awsmcollections.com/glossary/what-are-shopify-tags-and-how-to-use-them-effectively) *Disclaimer: While we strive to provide accurate and up-to-date information, we cannot guarantee the correctness of all content. Information may be outdated or incorrect, and we recommend verifying any information before relying on it.*