Skip to content

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.

SettingTypeDefaultWhat it does
HeadingTextYour bagThe page <h1>
Empty headingTextNothing here yetHeading when the cart is empty
Empty button labelTextShop the dropButton under it, linking to all products
Allow an order noteCheckboxtrueAllow an order note
Note labelTextOrder noteLabel on the note field
Tax noteTextTax 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 unlockedTextFree shipping — unlockedShown once the threshold is met
Free shipping remainingTextfrom free shippingFollows the remaining amount, e.g. “$40.00 from free shipping”
Checkout labelTextCheckoutSubmit button label
Continue labelTextContinue shoppingLink under the button
Show accelerated checkoutCheckboxtrueShop Pay, PayPal, Apple Pay and the other express buttons your store offers, under Checkout. See Accelerated checkout
Show a shipping estimatorCheckboxtrueShow a shipping estimator so shoppers can check delivery cost before checkout
Show discount code fieldCheckboxtrueA 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.

ElementSource
Thumbnailitem.image at 400w, linking to the product
Titleitem.product.title
OptionsEach option as Name: value, for example Size: M, from item.options_with_values. Hidden for products with no options
Subscriptionitem.selling_plan_allocation.selling_plan.name when the line is a subscription
Line item propertiesEvery entry in item.properties, as Name: value
DiscountsThe 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 priceitem.original_price with “each”. Products sold by weight or volume also show their unit price, for example $2.50/100g
Line totalitem.final_line_price, with the original struck through beneath it when a discount applied

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.

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.

Shared with the drawer, and driven entirely by global settings under Theme settings → Cart:

SettingWhat it does
Gift wrap productThe 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.

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%.

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 422 from 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" and aria-live="polite".

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:

LineSource
Itemscart.original_total_price — before any discount
Discountscart.total_discount, in the accent colour
Subtotalcart.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.