<dkl-volume-picker-radio-groups> is the source of the tier-change event in Discount Kit
Live. It has no direct reference to <dkl-price> — instead
it emits a tier-change event that the price (and any of your own code) can listen for,
coupled by event name and product id only.
Emits
widgetId and variantId. widgetId is the app block’s id — it’s null on a web component
which has no block. variantId is the product variant the picker is
bound to.Fired when a tier is selected or deselected. Bubbles, so you can listen on
document.
The detail carries resource:updatesPrice: Reflects the picker’s “Update price when a tier is selected” setting
(data-update-price-on-change). When it’s false, price components like
<dkl-price> ignore the tier for pricing — but the event
still fires, so your own integrations keep receiving it.<dkl-price> listens for this when updatesPrice is true, matched by product id — a
selected tier shows the discounted price, a null tier reverts to base.Lifecycle
Each Volume Picker 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 the sameDklWidgetEventDetail resource.
Fired once the controller has attached its behaviour to the (already server-rendered)
element.
resource: { widgetType, widgetId, productId?, variantId? } — productId and
variantId are included when known.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
A listener example and how to react to tier changes.
Discount Price
The price display that reacts to this picker’s tier-change events.