What Are Product and Cart-Based Rules?
Product and Cart-Based Rules are one of the most common ways to personalize product recommendations in Rebuy. You can create rules based on what a customer is viewing (product page) or what they’ve added to their cart. Additionally, the Rebuy widget offers recommendation modes like 'Recommended AI' to automatically suggest products, which can be refined further with custom rules for enhanced personalization.
This allows you to target upsell and cross-sell offers more effectively.
Rule Conditions You Can Use
When setting up these rules, you can choose from several conditions:
Product – The item currently being viewed or in the cart.
Product Vendor – The brand or vendor of the item.
Product Tag – Any tag associated with the item.
Product Title – The name of the product.
Product Type – The product’s classification or category.
Product Handle – The unique URL identifier for the product.
Understanding Logical Operators
Logical operators define how your conditions must be met for the rule to trigger. Here’s a breakdown:
Equals Anything
Triggers if any product is on the page or in the cart.
✅ Most commonly used
Contains Any
Triggers if any specified product(s) are present.
✅ Common and flexible
Does Not Contain Any
Triggers only if none of the specified products are in the cart.
⚠️ Less common
Contains All
Triggers only if all specified items are in the cart.
⚠️ Less common
Does Not Contain All
Triggers if the cart is missing any of the specified items.
⚠️ Less common
Equals
Triggers if the cart has only the specified items—nothing more.
❌ Rarely used
Does Not Equal
Triggers if the cart contains anything other than exactly the specified items.
❌ Rarely used
Examples of Product and Cart-Based Logical Operators
Use these examples to understand how each logical operator works when building rules in Rebuy. These operators determine when a rule is triggered based on the customer's current product page or cart contents.
🟢 Equals Anything
When to use: You want your widget to display something no matter what product is being viewed or what’s in the cart.
How it works:
If the customer is on any product page or has any item in their cart, show the specified item(s), collection, or data source.
🟢 Contains Any
When to use: You want to show something when at least one of several specific products is viewed or in the cart.
How it works:
If the customer is viewing any of the selected products or has any of them in the cart, show the chosen recommendation.
✅ Most popular and flexible operator.
🟡 Does Not Contain Any
When to use: You want to show an offer only when none of a specific group of items are present.
How it works:
If the customer is not viewing or doesn’t have any of the specified products in their cart, trigger the rule.
🟡 Contains All
When to use: You want a rule to trigger only when all specified items are in the cart.
How it works:
If the cart includes every product you've specified, show the recommended product(s).
⚠️ Use with caution—this is more specific and may limit when the rule fires.
🟡 Does Not Contain All
When to use: You want to exclude certain offers if the full set of items isn’t present.
How it works:
If the cart doesn’t include all specified items, return your selected item(s), collection, or data source.
🔴 Equals
When to use: You want to match the cart exactly—no more, no less.
How it works:If the cart contains only the specified product(s) and nothing else, trigger this rule.
Use Case for Cart Quantities
Equals for Specific Quantity Matching: Use "Equals" if you need the rule to match a specific number of products in the cart, such as targeting an offer when there are exactly two products in the cart. For example, set
Cart Line Equals 2
under your Rebuy post-purchase rule configuration.
🚫 Very strict—use sparingly.
🔴 Does Not Equal
When to use: You want to show something unless the cart exactly matches a specific combination.
How it works:
If the cart has anything other than exactly what you've specified, show the chosen item(s).
🚫 Rarely used due to its specificity.
Bonus: Use Other Product Attributes for Targeting
In addition to product-based rules, you can also target customers using:
Product Vendor
Product Tag
Product Title
Product Type
Product Handle
These can be used with the same logical operators to create more personalized, dynamic recommendations.
Troubleshooting and Best Practices
Verify the widget mode by checking its configuration ('Recommended AI' or custom rules).
Regularly review rules to address overlaps or conflicts between them.
Use clear naming conventions for collections/tags to streamline the rule creation process.
Test rules periodically to ensure they deliver accurate recommendations.
Practical Implementation Strategies
Using Tag or Collection Rules:
Organize products into logical categories using tags or Shopify collections and then create rules to refine recommendations.
Example: For products tagged 'Category A,' rules can restrict recommendations to only show products from 'Category A.'
Switching to Similar Sort AI Mode:
Leverage the 'Similar Sort' mode to generate recommendations based on product similarity. Note that this mode may include cross-category suggestions unless specific rules are applied.