Cart
The /cart page. Lines on the left, a summary column alongside carrying gift wrap, the free-shipping bar, a discount code field, the totals, checkout and an optional shipping estimator.
Most add-to-carts in Hanko land in the cart drawer rather than here, so treat this page as the considered view — the one a shopper opens to edit an order, read a note field or estimate shipping.
Section settings
Section titled “Section settings”| Setting | Type | Default | What it does |
|---|---|---|---|
| Heading | Text | Your bag | The page <h1> |
| Empty heading | Text | Nothing here yet | Heading when the cart is empty |
| Empty button label | Text | Shop the drop | Button under it, linking to all products |
| Allow an order note | Checkbox | true | Allow an order note |
| Note label | Text | Order note | Label on the note field |
| Tax note | Text | Tax and shipping calculated at checkout. | Fine print above the checkout button. When your prices include tax, it reads Taxes included. Shipping calculated at checkout. instead |
| Free shipping unlocked | Text | Free shipping — unlocked | Shown once the threshold is met |
| Free shipping remaining | Text | from free shipping | Follows the remaining amount, e.g. “$40.00 from free shipping” |
| Checkout label | Text | Checkout | Submit button label |
| Continue label | Text | Continue shopping | Link under the button |
| Show accelerated checkout | Checkbox | true | Shop Pay, PayPal, Apple Pay and the other express buttons your store offers, under Checkout. See Accelerated checkout |
| Show a shipping estimator | Checkbox | true | Show a shipping estimator so shoppers can check delivery cost before checkout |
| Show discount code field | Checkbox | true | A code field at the top of the summary. See Discount codes |
The section also accepts @app blocks, rendered in their own row under the lines — reviews, loyalty widgets, trust badges.
What each line shows
Section titled “What each line shows”| Element | Source |
|---|---|
| Thumbnail | item.image at 400w, linking to the product |
| Title | item.product.title |
| Options | Each option as Name: value, for example Size: M, from item.options_with_values. Hidden for products with no options |
| Subscription | item.selling_plan_allocation.selling_plan.name when the line is a subscription |
| Line item properties | Every entry in item.properties, as Name: value |
| Discounts | The name of each discount on the line — for a code, the code itself — in the accent colour. The amount is shown once, in the totals, not repeated per line |
| Unit price | item.original_price with “each”. Products sold by weight or volume also show their unit price, for example $2.50/100g |
| Line total | item.final_line_price, with the original struck through beneath it when a discount applied |
Quantity updates
Section titled “Quantity updates”The +, − and Remove controls all post to /cart/change.js with a line number and a quantity, handled by the theme’s global cart engine. On the cart page they additionally carry data-reload, so the page reloads after a successful change — the totals, the free-shipping bar and the discount rows are all server-rendered here, and a reload is the honest way to keep them consistent.
Errors are surfaced as a toast, with distinct copy for a network failure versus a store-side refusal, and the control is re-enabled rather than left spinning.
The order note
Section titled “The order note”With show_note on, the cart page shows a textarea under the lines. It saves itself:
- typing debounces for 500ms then posts to
/cart/update.js - blurring the field flushes immediately
- submitting the cart form (clicking Checkout) holds the submit just long enough to land a pending note, then lets it through — so a note typed and immediately checked out is never lost
The same behaviour drives the note field in the cart drawer.
Gift wrap
Section titled “Gift wrap”Shared with the drawer, and driven entirely by global settings under Theme settings → Cart:
| Setting | What it does |
|---|---|
| Gift wrap product | The wrap itself. Nothing renders unless this is set and the product is available |
gift_wrap_label (default Add gift wrapping) | The checkbox label; the wrap’s price is appended automatically |
The wrap is a real product, not a free-floating attribute — so it is priced, taxed, counted in inventory and fulfilled like anything else, rather than being a flag that never reaches the packing bench. Ticking the box adds the wrapping and unticking removes it. It isn’t listed with the items or counted in the bag; it appears as a Gift wrapping line in the totals instead. See Gift wrapping.
The checkbox state is derived by looking for the wrap’s variant id in the cart, so swapping the wrap product in settings does not leave a stale line ticked. If the add or remove fails, the checkbox is put back where the cart actually is.
The free-shipping bar
Section titled “The free-shipping bar”Driven by the global Cart → Free shipping threshold setting. When that setting is empty or zero, the bar does not render at all. When it is set, the bar shows either ship_unlocked or remaining + ship_away, with a progress track clamped at 100%.
The shipping estimator
Section titled “The shipping estimator”With show_estimator on, a <details> panel offers country, province and postal code, then calls /cart/shipping_rates.json and lists each rate with its price.
- The province field is populated from Shopify’s own country data and stays hidden for countries that have no provinces.
- A
422from Shopify is read rather than replaced with a generic failure, so an invalid postcode produces Shopify’s own explanation. - With no rates for the address, a dedicated “no rates” message is shown rather than an empty list.
- Output is announced via
role="status"andaria-live="polite".
The summary
Section titled “The summary”From the top: the free-shipping bar, the discount code field, then the totals.
With no discount, the totals are a single Subtotal line. When any discount applies — a code or an automatic one — they read as three lines:
| Line | Source |
|---|---|
| Items | cart.original_total_price — before any discount |
| Discounts | cart.total_discount, in the accent colour |
| Subtotal | cart.total_price — what is owed |
cart.total_discount is used deliberately rather than listing cart_level_discount_applications: a code that targets products (which most do) leaves that list empty, so a discounted cart would otherwise show no saving at all in the summary.
Below the totals: the tax_note, the checkout submit, the accelerated checkout buttons, and the continue-shopping link.
Related
Section titled “Related”- Cart drawer — the overlay version
- Product