<hk-price>
hk-price: Formats a price, with an optional compare-at price, for a product or a fixed amount. Syntax, props, defaults and examples.
On this page
Formats a price, with an optional compare-at price, for a product or a fixed amount.
Group: Product. Name in the editor: Price. Complete props for every tag: Tag reference.
Syntax
<hk-price />Children: None. The tag is self-closing.
Props
Write props as kebab-case attributes.
| Prop | Type | Required | Default | Allowed values | Editor label |
|---|---|---|---|---|---|
amount | number | no | - | - | Price |
compare-at | number | no | - | - | Compare at |
format | select | no | - | decimal, whole | Number format |
product | data | no | - | - | Product with variants |
Required props
None. Every prop has a default or can be left out.
Examples
From packages/templates-default/theme/snippets/price.snf, lines 2 to 2:
<hk-price amount="{{ product.price }}" compare-at="{{ product.compare_at }}" product="{{ product }}" />From docs/examples/example-store/sections/on-sale.snf, lines 12 to 12:
<hk-price amount="{{ p.price }}" compare-at="{{ p.compare_at }}" />Related tags
hk-product-card: A product card for a product, customizable through named parts.hk-product-grid: A grid of product cards for a list of products, with a limit and columns.hk-product-gallery: A product's images as a gallery with thumbnails.hk-variant-picker: Lets the shopper choose a product's options and variant.
