EzyStudio ADF

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.

TypeOperatorsFieldsAvailable In
customerTaghasAny, hasNonetagsAll 4 functions
customerIsAuthenticatedEquality (none)boolValueConditional
customerOrderCountNumericvalue, valueToConditional
customerTotalSpentNumericvalue, valueToConditional
cartSubtotalNumericvalue, valueToAll 4 functions
cartTotalQuantityNumericvalue, valueToAll 4 functions
cartLineCountNumericvalueConditional
marketisAny, isNonecountryCodesAll 4 functions
cartAttributeexists, notExists, equals, containskey, valuesConditional

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.

TypeOperatorsFieldsAvailable In
productTaghasAny, hasNonetagsConditional, Tiered
collectioninAny, inAll, inNonecollectionIdsConditional, Tiered
productTypeisAny, isNonevaluesConditional
productVendorisAny, isNonevaluesConditional
productisAny, isNoneproductIdsConditional, Tiered
productVariantisAny, isNonevariantIdsConditional, Tiered
linePropertyexists, notExists, equals, containskey, valuesConditional
lineQuantityNumericvalue, valueToConditional
linePriceNumericvalue, valueToConditional

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:

OperatorDescriptionRequired Fields
greaterThanValue must be strictly greater than the thresholdvalue
greaterThanOrEqualValue must be greater than or equal to the thresholdvalue
lessThanValue must be strictly less than the thresholdvalue
lessThanOrEqualValue must be less than or equal to the thresholdvalue
equalsValue must exactly equal the thresholdvalue
betweenValue 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 TypeConditionalTieredBXGYBundle
customerTagYesYesYesYes
customerIsAuthenticatedYesYesYesYes
customerOrderCountYesYesYesYes
customerTotalSpentYesYesYesYes
cartSubtotalYesYesYesYes
cartTotalQuantityYesYesYesYes
cartLineCountYesYesYesYes
marketYesYesYesYes
cartAttributeYesYesYesYes
productTagYesYesNo*No*
collectionYesYesNo*No*
productTypeYesNoNo*No*
productVendorYesNoNo*No*
productYesYesNo*No*
productVariantYesYesNo*No*
linePropertyYesNoNoNo
lineQuantityYesNoNoNo
linePriceYesNoNoNo

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.