Skip to content
House of Marka
AppsServicesMarketplacesWorkInsightsCompanyStart a project
D2C & Growth5 min readBy

Should You Show a Discount Code Box in Your Shopify Cart?

Whether to show a discount code field in a Shopify cart: the trade-off, the collapsed-link option, automatic discounts, and keeping totals consistent.

Show it, but quietly. A collapsed 'Have a code?' link in the cart serves the shopper who has a code without telling everyone else that they are missing one. If your discounts are meant for all shoppers, make them automatic and the question mostly goes away. This guide covers the trade-off, where Shopify applies codes, the four ways to handle the field, and how to keep the cart total and the checkout total in agreement.

What is the trade-off?

A discount field does two opposite things, depending on who is looking at it.

To a shopper with a code, the field is reassurance. They were sent the code in an email or saw it on a creator's post, and they want to see it accepted before they commit. If the cart shows no place for it, they wonder whether it will work and may hold off.

To a shopper without a code, a prominent empty box is a prompt. It says other people are paying less. Some open a new tab to look for a code, and a shopper who has left the store to search may find a competitor, lose the thread, or come back with a code you never meant them to have.

Where does Shopify apply discount codes?

At checkout. Shopify's checkout has its own discount field, and that is where a code is validated and its effect calculated. A code can also be attached earlier: by a cart that accepts one and passes it on, or by a link that carries the code so it is already applied when the shopper arrives.

Automatic discounts are different. They need no code; Shopify applies them when the cart meets the conditions you set.

Two consequences follow:

  • Leaving the field out of the cart does not stop anyone using a code. They can still enter it at checkout.
  • A cart that accepts a code is making a promise about what checkout will do with it. The two have to agree.

What are the options?

1. No field in the cart. Codes are entered at checkout only. This suits stores that rarely issue codes.

2. A collapsed link. A small text link such as 'Have a code?' that opens the field when tapped. Code holders recognise it; everyone else reads past it. This suits most stores that use codes in their marketing.

3. An open field. Always visible, with an 'Apply' button. This suits a store where nearly every order uses a code, for instance one that sells mainly through creators and affiliates.

4. Automatic discounts instead of codes. The discount applies itself and the cart shows it. Nothing to type, nothing to hunt for.

When should you use automatic discounts instead?

When the discount is for everyone who meets a condition, not for a particular audience. A sitewide sale, a spend threshold, a quantity discount and a bundle price are all cases where a code only adds a step and a chance to fail.

Keep codes for discounts tied to a person or a channel:

  • a welcome offer for new subscribers,
  • a creator or affiliate code you need to attribute,
  • an apology or a win-back sent by support.

For those, a link that applies the code on arrival works better than asking the shopper to type it. The shopper sees the discount in place, and you still get the attribution.

Offers that live only in the cart are a related tool; see cart-only deals.

How do you keep the cart and checkout totals consistent?

By making sure the cart shows only what Shopify will apply. If the cart accepts a code, it has to respect every rule checkout does:

  • Combinations. Shopify lets you set which discounts combine with each other. If a code does not combine with an automatic discount already on the cart, checkout applies one of them, not both. The cart must show the same outcome.
  • Conditions. A code with a minimum spend, or limited to certain products or customers, must be refused in the cart for the same reasons checkout would refuse it.

A cart that takes any text, shows a cheerful 'Applied' and leaves checkout to deliver the bad news has only delayed the disappointment. That is one of the common reasons covered in why the cart total does not match checkout.

Check the progress bar too. If a code lowers the subtotal, decide whether the shopper's progress towards free shipping counts the cart before or after the discount, and make sure the bar uses the same rule as the shipping rate that grants it.

Marka Cart Drawer includes a discount box and an order note on its free plan, applies its own offers through a Shopify discount function, and has a Discount Explainer that shows why a cart got its total.

What should the field say when a code fails?

Why, in plain words. 'Invalid code' sends the shopper back to their inbox or to support. Better messages name the reason:

  • 'This code needs a cart of $50 or more.'
  • 'This code has expired.'
  • 'This code cannot be combined with the offer already applied.'

How do you test it?

  1. Enter a valid code in the cart and confirm checkout shows the same discount.
  2. Enter a code alongside an automatic discount and compare the outcome in both places.
  3. Enter an expired code and a code below its minimum spend; read the messages.
  4. Open a link that carries a code and check the cart shows it applied.
  5. Remove an item so the cart falls below the code's minimum, and see whether the cart updates.

A short checklist

  1. Decide which of your discounts are for everyone, and make those automatic.
  2. Put the code field behind a 'Have a code?' link unless nearly every order uses a code.
  3. Send codes as links that apply on arrival where you can.
  4. Make the cart refuse codes for the same reasons checkout would.
  5. Write failure messages that name the reason.
  6. Test each code type through to checkout.

The discount field is a small part of the cart with a large effect on trust in the total. For the rest of what a cart should contain, see our cart drawer guide; for a drawer with a discount box built in, see Marka Cart Drawer.

Work with us

House of Marka is the applied-AI and commerce engineering studio of Marka Modern Retail Private Limited. We research, advise and then build — for merchants and enterprises in the US, UK and Europe.