Skip to content
← Back to Index

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

PromotionRuleReactor

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 |> nothing

See Also

© 2024 Hantera AB. All rights reserved.