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