Discount Code Field in the Shopify Cart: Show It, Hide It, or Collapse It?
An empty promo code box sends shoppers off to coupon sites. Here is when to show the discount code field in your Shopify cart, when to hide it, and why a collapsed link is the best default.
Nearly 3 in 4 Americans (74%) say they have left a cart to go hunt for a coupon or promo code, according to a March 2026 CouponFollow survey of 1,016 shoppers. That is the whole debate in one number. An empty "Discount code" box in your cart is a question. And a lot of shoppers answer it by opening a new tab.
Some of them come back with a code. Some come back with a code from a coupon site that you never meant to publish. Some never come back.
So should you show the discount code field in your Shopify cart, hide it, or do something in between? Short answer: for most stores, collapse it behind a small link, push automatic discounts instead of codes, and only open the field wide when the visitor clearly arrived with a code. Here is why, and how to set it up.
Why an open coupon box costs you sales
The problem is not the discount. It is the empty field.
Baymard Institute, which has tested checkout flows since 2016, sums up its guideline on promo fields in one line: they "are distracting and encourage some users to leave the checkout process to hunt for coupons off-site" (Baymard guideline #615, updated July 2026). Baymard rates the issue as "Essential".
Nielsen Norman Group saw the same thing in user testing. On a car rental site, participants who noticed an open coupon field went straight to Google to look for codes. Their recommendation: unless a valid code is always visibly available on your site, "it's best not to provide an open text field" (NN/g, Applying Discounts and Promotions).
The behavior is now a habit. In the same CouponFollow survey, 51% of Americans say they almost always search for a coupon before buying anything online. Zuko, a form analytics company, also cites a PayPal and Comscore study where 27% of people said they would abandon their cart to search for a voucher code (Zuko).
Three things happen when a shopper leaves to search:
- Some never return. The tab with your store sits behind ten coupon sites and a YouTube video.
- Some return with a code you did not want public. Your influencer code, your win-back code, your 30% staff code. Margin gone.
- Some return empty-handed and feel cheated. "Everyone else gets a discount except me." Not the mood you want right before payment.
Hiding it completely is not free either
Before you delete the field, think about who actually has a code.
- People who signed up to your newsletter pop-up for 10% off.
- People who clicked an influencer's story with a code in it.
- People who got an abandoned cart email with an incentive.
- Customers coming back with a loyalty or referral reward.
These are your warmest visitors. They expect to type that code somewhere, and they want to see the new total before they commit. NN/g's research recommends reflecting all discounts in the order total before you ask for payment details. If the cart has no field at all, these shoppers have to trust that the code will work on the next step.
On Shopify, they can still enter it at checkout, since Shopify's checkout includes a discount code field. That is your safety net. The question is only whether the cart should show it too.
Show, hide or collapse: a decision table
Your situation | What I would do in the cart | Why |
|---|---|---|
You rarely run codes, mostly automatic discounts | Hide the field in the cart, keep it at checkout | Nothing to gain from inviting a search |
Newsletter pop-up with a welcome code | Collapsed link: "Have a discount code?" | Code holders find it, others are not prompted |
Heavy influencer or affiliate traffic | Collapsed link, plus discount links that pre-apply the code | Most code holders never need to type |
Big sales events with a public code (Black Friday) | Open field, with the code already shown on the site | NN/g's exception: the code is visible, no hunting needed |
High AOV, long consideration (furniture, electronics) | Collapsed link, test hiding it | Shoppers take time, coupon sites have time to win |
B2B or wholesale with negotiated codes | Open field | Buyers come with codes by design |
The pattern: an open field is fine when everyone already knows the code. When only a minority has one, collapse it.
The middle ground: a collapsed link
This is the option I would start with on almost every store.
Instead of an empty input, show a small text link under the subtotal: "Have a discount code?" A click expands the field. NN/g suggests exactly this, a text link that exposes the field, and Zuko lists it as its first fix.
Why it works:
- Shoppers with a code look for it and find it in a second.
- Shoppers without a code see a quiet link, not a blank box asking them for something they do not have.
- You keep the "see the new total in the cart" benefit for the people who need it.
Copy details that matter
- Label: "Have a discount code?" or "Add a promo or gift card". Short, calm, no capital letters shouting.
- Field size: long enough to show your longest code. NN/g specifically flags fields that cut off codes.
- Apply button: a visible "Apply" right next to the field, not "press Enter".
- Success message: show the saved amount in money, not just "Code applied". "You saved $12.40" is a small win that pushes people forward.
- Error message: say why it failed. "This code starts on Friday" or "Minimum order $50, add $8.20 more" beats "Invalid code".
How to set it up on Shopify
There are four realistic routes. Pick by how much control you want.
1. Do nothing in the cart, rely on checkout
If your theme's cart has no discount field, your shoppers can still type codes at checkout. This is the "hidden" option by default. It is a fine choice if most of your promotions are automatic discounts.
2. Use your theme's own option, if it has one
Some themes include a discount field in the cart or cart drawer. Check the theme editor: open the cart page or cart drawer settings and look for a discount or promo code toggle. Settings differ from one theme to another, so check your own theme's docs before assuming anything. If you do not find it, it is not there. The Shopify Community has long threads from merchants asking how to add one to Dawn.
3. Use a cart drawer app
Most cart drawer apps include a promo code field you can switch on or off, plus a free shipping bar and in-cart recommendations. This is the no-code route and lets you change your mind in one click. If you want to compare options, our Kazam Cart vs Rapid Cart comparison is a good place to start, and our guide to customizing a Shopify cart drawer without code covers the rest of the drawer. For what it is worth, the ConvertX cart drawer has a promo code field among its options, next to the shipping bar and recommendations.
4. Build it with the Ajax Cart API
If you have a developer, Shopify added discount support to the Cart Ajax API's /cart/update.js endpoint in May 2025, through a discount parameter (Shopify changelog). Before that, themes had to fake it, usually by passing the code to checkout in the URL. Now a custom field can apply or remove a code in the cart itself and refresh the totals. Ask your developer to handle the error states properly; that is where custom builds usually cut corners.
Reduce the need for codes in the first place
The best coupon field is one nobody needs.
- Automatic discounts. Shopify lets you create discounts that apply without a code. "Buy 2, get 10% off" works better as an automatic tier on the product page than as a code someone must remember.
- Discount links. Shopify generates a shareable link for each code. Use it in emails, SMS and influencer bios. The code is applied when the visitor lands, and they never need to type it.
- Show the offer in the cart. If there is a public promotion, display it in the cart with the code, or better, already applied. This is NN/g's first recommendation: make offers clickable so they apply on their own.
- Use private and single-use codes. Zuko suggests splitting codes into public, private and restricted single-use ones. When a private code leaks to a coupon site, a single-use code limits the damage.
- Give value that is not a code. A free shipping threshold, a gift with purchase, a quantity bundle. These raise order value without turning your cart into a treasure hunt. Our guide to reducing cart abandonment on Shopify goes deeper on these levers.
How to test it on your own store
Do not trust anyone's blanket rule, including mine. Your traffic mix decides.
- Write down your baseline for 2 to 4 weeks: cart-to-checkout rate, checkout conversion rate, average order value, and share of orders with a discount code (Shopify Analytics shows discount usage).
- Change one thing: move from open field to collapsed link, or from collapsed to hidden.
- Run the same length of time again, outside of a sale period. A Black Friday week will wreck any comparison.
- Check what codes are being used. If a private code suddenly shows up in lots of orders, it has leaked. Retire it.
- Decide on revenue per visitor, not on conversion alone. Hiding the field might lift conversion slightly while fewer discounted orders lift margin too. Or the opposite.
If you are hesitating between a cart page and a cart drawer for all of this, we compared both in cart page vs cart drawer on Shopify.
What I would do
If I ran a typical Shopify store with a welcome pop-up, some influencer traffic and a few sales a year, here is my setup:
- Collapsed "Have a discount code?" link in the cart drawer, never an open box.
- Discount links everywhere a code is shared, so code holders arrive with it already applied.
- Automatic discounts for quantity tiers and seasonal offers.
- Open field only during public sales, with the code also shown in the announcement bar.
- Monthly check of which codes appear in orders, to catch leaks.
Hiding the field completely is tempting, but it punishes your best visitors, the ones who just gave you their email. Leaving it wide open sends the rest to Google. The collapsed link solves both problems.
Frequently asked questions
Not necessarily. Removing it stops some shoppers from leaving to hunt for codes, but it also hides the field from your best visitors, like newsletter subscribers with a welcome code. For most stores, a collapsed "Have a discount code?" link in the cart is the better default. Shoppers can still enter codes at Shopify's checkout either way.
It can. Baymard Institute says promo fields are distracting and push some users to leave checkout to hunt for coupons, and a March 2026 CouponFollow survey found 74% of Americans have left a cart to search for a code. The impact depends on your traffic, so measure it on your own store before and after a change.
Check your theme editor first: some themes have a discount field option in the cart or cart drawer settings. If yours does not, a cart drawer app usually includes a promo code field you can toggle. A developer can also build one with the Cart Ajax API, since Shopify added a discount parameter to /cart/update.js in May 2025.
Automatic discounts that apply without a code, shareable discount links that pre-apply a code when the visitor lands, and non-code value like free shipping thresholds, free gifts and quantity bundles. These reduce the number of shoppers who feel they need to search for a code.