Automatic Discounts
Automatic discounts are cart-level discounts that apply automatically based on formula logic — no promocode required. They work similarly to extra fees but reduce the cart total instead of adding to it.
Where to configure
Admin → Marketing → Automatic Discounts
Key rules
The formula must produce a positive value for the discount to be applied. Zero, blank, or negative values are ignored.
Automatic discounts only apply to orderline items. They do not discount extra fees or shipping.
If the discount amount exceeds the orderlines total, it is clipped to the orderlines total. The excess does not carry over to extra fees or shipping. For example: $20 in orderlines + $5 rush fee + $10 shipping, and the formula produces $50 — the discount is capped at $20. The customer still pays $5 + $10 + taxes.
Automatic discounts stack with promocodes by default. If you want to prevent an automatic discount from applying when a promocode is active, you need to guard it with Liquid (see examples below).
Automatic discounts are applied before extra fees. This means extra fee formulas can see automatic discount values, but automatic discount formulas cannot see extra fees.
Combining behaviour
By default, automatic discounts do not combine with each other. When multiple automatic discounts are configured, the system picks the single discount that produces the largest amount.
If you tick the "Combines" checkbox on an automatic discount, it is allowed to combine with other automatic discounts that also have "Combines" enabled. The system automatically evaluates all possible combinations and picks the one that produces the largest total discount.
Example:
Auto discount A: 15%, combines = yes
Auto discount B: 15%, combines = yes
Auto discount C: 20%, combines = no
Auto discount D: 50%, combines = no
The system evaluates:
A + B combined = 30%
C alone = 20%
D alone = 50%
Result: D wins (50% is the largest). But if D were only 25%, the system would pick A + B (30%).
Formula basics
Automatic discount formulas use the same Ruby expression syntax as extra fee and product pricing formulas, with the same restricted set of cart-level variables:
orderlines_total
Sum of all orderline prices in the cart, before discounts, extra fees, shipping, and taxes
orderlines_discount
Promocode discount applied to orderlines — does not include other automatic discounts
These are the only pricing variables available. You do not have access to quantity, units, pages, or any other product-level variables — automatic discounts operate at the cart level.
Liquid in automatic discount formulas
Like extra fees, automatic discount formulas support Liquid. The Liquid is evaluated first, and whatever it outputs is then evaluated as a Ruby pricing expression.
Available Liquid variables
cart
Yes
With restrictions — same as extra fees
user
Yes
Full access
website
Yes
Full access
Cart properties that do NOT work
Same restrictions as extra fees — these properties can depend on downstream calculations:
cart.totalcart.shippingcart.discountcart.shipping_discountcart.tax
Cart properties that DO work
cart.orderlines_totalcart.orderlines_discountcart.promocode_codeAll non-pricing properties:
cart.custom,cart.orderlines,cart.address,cart.shipping_option, etc.
Interaction with extra fees
Automatic discounts are applied before extra fees in the calculation order:
Orderline prices
Promocode discounts
Automatic discounts
Extra fees
Shipping
Tax
This means extra fee formulas now have access to an additional pricing variable:
auto_discount
Total amount of all applied automatic discounts
Extra fee formulas can also use the Liquid variable cart.auto_discounts to inspect which specific automatic discount(s) were applied.
Examples
Flat discount on all orders
Discount every order by $5:
Percentage discount
10% off the orderline total:
Spend threshold — discount when cart exceeds a value
Give $10 off when the cart orderlines total is $50 or more:
Tiered percentage discount by cart value
Scale the discount percentage based on how much the customer is spending:
Discount for a specific user category
Give wholesale users 20% off automatically:
Prevent stacking with promocodes
Only apply the automatic discount if the customer has not already entered a promocode:
Conditional discount based on a cart custom field
Apply a discount when a specific cart custom field value is set (e.g. a loyalty flag):
Extra fee formula that accounts for automatic discounts
An extra fee that calculates a rush charge on the net orderline value after both promocode and automatic discounts have been applied:
Last updated