Conditions Overview
Conditions Overview
The Advance Discount Function supports 18 condition types organized into two categories: cart-level conditions that evaluate once against the entire cart, and product-level conditions that evaluate individually per cart line. Understanding the distinction between these categories is fundamental to building effective discount rules.
Cart-Level Conditions (9 Types)
Cart-level conditions are evaluated once against the overall cart state. If a cart-level condition fails (in AND logic), the entire rule group fails — no per-line evaluation occurs.
| Type | Operators | Fields | Available In |
|---|---|---|---|
customerTag | hasAny, hasNone | tags | All 4 functions |
customerIsAuthenticated | Equality (none) | boolValue | Conditional |
customerOrderCount | Numeric | value, valueTo | Conditional |
customerTotalSpent | Numeric | value, valueTo | Conditional |
cartSubtotal | Numeric | value, valueTo | All 4 functions |
cartTotalQuantity | Numeric | value, valueTo | All 4 functions |
cartLineCount | Numeric | value | Conditional |
market | isAny, isNone | countryCodes | All 4 functions |
cartAttribute | exists, notExists, equals, contains | key, values | Conditional |
For detailed documentation of each cart-level condition, see the Cart-Level Conditions reference.
Product-Level Conditions (9 Types)
Product-level conditions are evaluated per cart line. They determine which individual lines are eligible for the discount rather than whether the rule fires at all.
| Type | Operators | Fields | Available In |
|---|---|---|---|
productTag | hasAny, hasNone | tags | Conditional, Tiered |
collection | inAny, inAll, inNone | collectionIds | Conditional, Tiered |
productType | isAny, isNone | values | Conditional |
productVendor | isAny, isNone | values | Conditional |
product | isAny, isNone | productIds | Conditional, Tiered |
productVariant | isAny, isNone | variantIds | Conditional, Tiered |
lineProperty | exists, notExists, equals, contains | key, values | Conditional |
lineQuantity | Numeric | value, valueTo | Conditional |
linePrice | Numeric | value, valueTo | Conditional |
For detailed documentation of each product-level condition, see the Product-Level Conditions reference.
Numeric Operators
All condition types marked as “Numeric” in the tables above support the following operators:
| Operator | Description | Required Fields |
|---|---|---|
greaterThan | Value must be strictly greater than the threshold | value |
greaterThanOrEqual | Value must be greater than or equal to the threshold | value |
lessThan | Value must be strictly less than the threshold | value |
lessThanOrEqual | Value must be less than or equal to the threshold | value |
equals | Value must exactly equal the threshold | value |
between | Value must fall within a range (inclusive) | value, valueTo |
When using the between operator, value represents the lower bound and valueTo represents the upper bound (both inclusive).
{
"type": "cartSubtotal",
"operator": "between",
"value": 50,
"valueTo": 200
}
AND/OR Logic
Conditions within a rule group are combined using the conditionLogic field, which accepts either "and" or "or". The behavior of these operators differs in nuanced ways, particularly when mixing cart-level and product-level conditions together.
For a full explanation of how AND and OR logic interact with the two condition categories, including edge cases and worked examples, see the Rule Groups & Logic reference.
Condition Availability Matrix
Not all conditions are available in every function type. The matrix below provides a complete view of which condition types are supported in each of the four discount functions.
| Condition Type | Conditional | Tiered | BXGY | Bundle |
|---|---|---|---|---|
customerTag | Yes | Yes | Yes | Yes |
customerIsAuthenticated | Yes | Yes | Yes | Yes |
customerOrderCount | Yes | Yes | Yes | Yes |
customerTotalSpent | Yes | Yes | Yes | Yes |
cartSubtotal | Yes | Yes | Yes | Yes |
cartTotalQuantity | Yes | Yes | Yes | Yes |
cartLineCount | Yes | Yes | Yes | Yes |
market | Yes | Yes | Yes | Yes |
cartAttribute | Yes | Yes | Yes | Yes |
productTag | Yes | Yes | No* | No* |
collection | Yes | Yes | No* | No* |
productType | Yes | No | No* | No* |
productVendor | Yes | No | No* | No* |
product | Yes | Yes | No* | No* |
productVariant | Yes | Yes | No* | No* |
lineProperty | Yes | No | No | No |
lineQuantity | Yes | No | No | No |
linePrice | Yes | No | No | No |
All 9 cart-level conditions are supported in all 4 functions — they share the same evaluation code. The Conditional function supports all 18 condition types. The Tiered function supports a subset focused on customer segmentation and product filtering. BXGY and Bundle functions support only cart-level conditions; product-level filtering is done via Item Filters instead.
* Product-level filtering in BXGY and Bundle is handled via Item Filters (buyItemFilter, getItemFilter, bundleItems[].filter) rather than conditions.