<dkl-order-goal> recomputes its progress on every cart update and emits a single custom
event when the cart total crosses a tier boundary. To run your own logic on a tier change,
listen for it — see Reacting to changes
and the examples on the web component page.
Emits
widgetId. The app block’s id — null on a web component. discountId identifies which order goal a
concurrent instance tracks.Fired when the cart total crosses a tier boundary. The initial render establishes the
baseline silently — the event fires only on a subsequent change, in either direction
(unlocking a tier, or dropping below one when items are removed). The detail carries
Note
resource:currentTier.discountAmount is the raw config value — a percent, or cents for
fixedAmount.Lifecycle
Each Order Goal instance also emits mount and unmount events as its behaviour attaches and tears down — handy for wiring up (and cleaning up) custom integrations per instance. Both bubble and carry aDklWidgetEventDetail resource. Order goals are
order-level, so the payload is just widgetType and widgetId (no product/variant).
Fired once the controller has attached its behaviour to the (already server-rendered)
element, after the baseline tier is established.
resource: { widgetType, widgetId }.Fired when the instance tears down — e.g. the element is removed, or the theme editor
re-renders the section. Same
resource shape. Use it to detach any listeners or observers
you set up on mount.Next steps
Web Components
Listener and payload examples for reacting to tier changes.
Order Goal overview
What the component does, and how it reads the cart total.