Cart predicate language
Cart predicates are boolean expressions evaluated against the current cart.
Thor uses them to decide whether a checkout rule is eligible. If the predicate returns true, the rule can apply. If it returns false, the rule is ignored for that cart.
Use this language for:
CartDiscount.predicateShippingMethod.predicateAbsoluteShippingMethodRate.predicateRelativeShippingMethodRate.predicate
Empty predicates are treated as true.
Available context
Thor evaluates cart predicates against resolved checkout data.
Common top-level fields include:
customershipping_addressbilling_addresstotalsubtotalcurrency_codestoreprice_channelline_items
That means predicates describe business eligibility, not frontend state.
Common patterns
Most production predicates follow a few repeatable patterns:
- customer targeting
- country or address targeting
- minimum subtotal checks
- line-item filtering
Keep the predicate focused on eligibility. Put cart-wide eligibility on the main discount or shipping rule, and line-item-specific checks on line-item target predicates.