<dkl-price> tag written directly into your theme’s Liquid. On a
product page it needs zero attributes — it clones a pre-staged carrier and renders
the primary product’s price server-side.
Usage
On a product page, add the<dkl-price> web component — it renders the primary product’s price server-side:
Reacting to changes
<dkl-price> emits a discount-kit-live:price:change event whenever its displayed price
updates — the recommended hook for running your own code when the price moves. It carries the
previous and new price (see the Events reference). See
Listen for price changes below.
Two narrower alternatives:
- Listen for the tier event — the volume picker’s
discount-kit-live:volume-discount:tier-change, e.g. to read the selected tier’s quantity. See Listen for tier changes. - Watch the discounted state — if you only care about whether this element is showing a
discount, observe its
data-dkl-discountedattribute (set while a tier is active) with aMutationObserver:
Examples
For the full list ofdata-* attributes you can set, see
Styling & Data Attributes.
Override attributes + tokens
Listen for price changes
Listen for tier changes
Next steps
Styling & Data Attributes
Every
data-* attribute, --dkl-* token, and CSS part.App block
The no-code, theme-editor placement.