Skip to content
Docs

Events

The gift selector emits the quickview’s events — opened, loaded, panel changes, variant changes, closed — plus the two below. All bubble to document; the payload is on event.detail.resource.

discount-kit-live:quickview:selection-change

Section titled “discount-kit-live:quickview:selection-change”

CustomEvent

A slot was filled or cleared.

{
slots: [
{ id: 't1-a', group: 0, variantId: 41200000000001 },
{ id: 't1-b', group: 0, variantId: null },
],
complete: false, // true once every slot is filled
}

CustomEvent

In selection mode the add-to-cart event carries mode: 'selection' and one entry per written slot in lines; the single-line fields describe the first line, for listeners that don’t know about selection mode.

{
mode: 'selection',
lines: [
{
slotId: 't1-a',
productHandle: 'tote-bag',
productId: 7820000000001,
variantId: 41200000000001,
quantity: 1,
properties: { _dk_gift: 'Spend $50 gifts', _dk_gift_tier: '0' },
variant: { … },
featuredImage: 'https://cdn.shopify.com/…',
selectedOptionValues: ['Natural'],
},
],
productHandle: 'tote-bag', // …the first line, repeated
productId: 7820000000001,
variantId: 41200000000001,
quantity: 1,
response: { … }, // the cart write's result, or null with submitLines
}

Product-mode opens are unchanged and carry mode: 'product' with a one-entry lines.

CustomEvent on document, from the Gift with purchase embed

Fired after every cart pass with detail.changeable: whether a claimed gift tier offers a choice. <dkl-change-gifts> shows and hides on it.

The embed’s own event listing gifts to add and remove on every cart pass, documented on the Gift with purchase page.