<hk-cart-items>
hk-cart-items: Lists the cart's lines, customizable through named parts. Syntax, props, defaults and examples.
On this page
Lists the cart's lines, customizable through named parts.
Group: Cart and checkout. Name in the editor: Cart items. Complete props for every tag: Tag reference.
Syntax
<hk-cart-items>
<hk-part name="…">…</hk-part>
</hk-cart-items>Children: Only <hk-part>.
Props
Write props as kebab-case attributes.
| Prop | Type | Required | Default | Allowed values | Editor label |
|---|---|---|---|---|---|
checkout-label | text | no | - | - | Cart link label (no JavaScript) |
Required props
None. Every prop has a default or can be left out.
Examples
From packages/templates-default/theme/sections/header.snf, lines 67 to 67:
<hk-cart-items />From packages/templates-default/theme/sections/cart-main.snf, lines 6 to 19:
<hk-cart-items checkout-label="{{ section.settings.checkout_label }}">
<hk-part name="empty">
<div class="sf-empty">
{% if section.settings.empty_image %}
<hk-image src="{{ section.settings.empty_image }}" alt="" width="240" />
{% endif %}
{% if section.settings.empty_title %}
<h2 class="sf-empty-title">{{ section.settings.empty_title }}</h2>
{% endif %}
{% if section.settings.empty_text %}
<p>{{ section.settings.empty_text }}</p>
{% endif %}
{% render 'button', label: section.settings.empty_button_label, href: section.settings.empty_button_link, style: section.settings.empty_button_style %}
</div>Related tags
hk-price: Formats a price, with an optional compare-at price, for a product or a fixed amount.hk-add-to-cart: The add to cart button for a product, with quantity and sold-out states.hk-cart-count: Shows the number of items in the cart.hk-cart-summary: The cart subtotal and the checkout button.hk-cart-drawer: A slide-in cart panel that can open when an item is added.hk-inline-checkout: Embeds Hekana's checkout for one product inside the page.
