Discount codes
Shoppers can enter a discount code in the cart drawer or on the cart page and see it take effect straight away — the code, the saving, and the new total — instead of finding out at checkout whether it worked.
Most themes leave the code box to checkout. Hanko checks the code in the cart, so a mistyped or expired code gets a clear message while the shopper is still looking at their bag.
What the shopper sees
Section titled “What the shopper sees”In the cart drawer, an Add a discount row sits at the end of the extras, under Add gift wrapping and Add a note. It opens to a code field and an Apply button. The row always starts closed, even with a code applied, because the applied code is named in the totals instead.
On the cart page, the field sits at the top of the summary column, above the totals.
Once a code is accepted:
- It appears as a small tag — for example
30OFF −$400.00— with an × to remove it. - Each discounted product shows the code’s name, and its line price shows the new price with the original struck through beneath it.
- The totals read as three lines, top to bottom. The Discounts line names the applied code in brackets:
| Line | Example |
|---|---|
| Items | $2,000.00 |
| Discounts (30OFF) | −$400.00 |
| Subtotal | $1,600.00 |
With no discount, the totals collapse back to a single Subtotal line.
If a code doesn’t apply, the shopper sees That code isn’t valid for this order. right under the field, and nothing else changes.
There’s nothing to set up beyond creating discount codes in Shopify admin → Discounts. The field is on by default in both places.
To hide it, untick Show discount code field in either section:
- Cart drawer section — hides it in the drawer
- Cart section — hides it on the cart page
You might hide it if you rarely run codes and don’t want shoppers leaving to search the web for one.
Settings
Section titled “Settings”| Section | Setting | Type | Default | What it does |
|---|---|---|---|---|
| Cart drawer | Show discount code field | Checkbox | On | Shows the Add a discount row in the drawer |
| Cart | Show discount code field | Checkbox | On | Shows the code field on the cart page |
Automatic discounts
Section titled “Automatic discounts”Automatic discounts — the ones you set up without a code — don’t need the field. They show on their own: the product’s line price is struck through, and the Discounts line appears in the totals. That works whether the field is on or off.
Good to know
Section titled “Good to know”The cart checks the code; checkout confirms it. Shopify applies the discount at checkout. In nearly every case what the cart shows is what the shopper pays — but a code limited to particular customers (a customer segment, or “first order only”) can look accepted in the cart and then be refused at checkout once the shopper enters their email. Test a restricted code all the way through checkout before you promote it.
Several codes at once only work if your discounts are set to combine. That’s a setting on each discount in admin, under Combinations. If they don’t combine, only one of them will apply.
Remove a code with the × on its tag. The totals update immediately.
Accessibility
Section titled “Accessibility”- The field has a label for screen readers, and pressing Enter applies the code.
- A refused code is announced to screen readers as soon as it appears.
- Each tag’s × button is named for the code it removes — Remove discount 30OFF.