Skip to content
← Back to Index

order

Keyword

 order 

The order keyword provides access to the current order state within a promotion component. It returns the full Order record, including deliveries, order lines, shipping, and dynamic fields.

order is a symbol — use it directly without parentheses.

Availability

PromotionRuleReactor

Examples

Check order total

filtrera
from order.total >= 500 match
  true |> percentage(order, 10%)
  false |> nothing

Access order lines

filtrera
let electronicLines = order.deliveries
  select d => d.orderLines
  flatten
  where line => line.dynamic->'category' == 'electronics'

from electronicLines count > 0 match
  true |> percentage(target(e => e is OrderLine and e.dynamic->'category' == 'electronics'), 15%)
  false |> nothing

Use as discount target

The order symbol can be passed directly to percentage or absolute as a target that covers all order lines and shipping:

filtrera
from percentage(order, 5%)

See Also

© 2024 Hantera AB. All rights reserved.