absolute
Keyword
absolute(target: Target | [Target], amount: number): CalculatedDiscount The absolute keyword creates a fixed-amount discount effect. It takes a target (from target or order) and a monetary amount, and returns a discount effect record.
The amount is in the order's currency. Whether it's treated as including or excluding tax depends on the order's taxIncluded setting.
Availability
| Promotion | Rule | Reactor |
|---|---|---|
| ✓ |
Examples
Fixed 50 off the entire order
filtrera
from absolute(order, 50)Fixed 10 off each qualifying order line
filtrera
from absolute(target(e => e is OrderLine and e.quantity >= 3), 10)Fixed shipping discount
filtrera
from absolute(target(e => e is Delivery), 25)Conditional absolute discount
filtrera
param couponValue: number
from order.total >= 200 match
true |> absolute(order, couponValue)
false |> nothingSee Also
- percentage — apply a percentage discount
- target — select which parts of the order to discount
- order — target the entire order
- Order Promotions — how promotions work