Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi, I'm looking for the location of the discount code input field in the theme code, I can't quite find it. I need to hide the discount code input field for users with a certain tag on them. I'm thinking of just a simple conditional rendering for the discount code input field.
If anyone can provide insight on where that code lies, or an alternative to prevent users with a specific tag from using discounts, that would be really appreciated!
Solved! Go to the solution
This is an accepted solution.
A screenshot is useless for solutions needing reproduction and inspection.
Be aware checkout.liquid customizations are being depreciated next year
https://changelog.shopify.com/posts/the-checkout-liquid-theme-file-is-being-deprecated
If this is for checkout the main way to not have the discount field is to not have any manual discount codes in the store. Meaning using only automatic-discounts or checkout-scripts.
Beyond that the actual CSS varies and has to be maintained, read constantly monitored.
Be sure to make a backup and !important 💣read guidance on editing that template.
https://shopify.dev/docs/themes/architecture/layouts/checkout-liquid
Roughly target the discount form with something like following, but that actual CSS can be different because of the utter worthless selector soup shopify insists on rendering in in some cases.
#Form0 { display: none; }
/* or */
.order-summary__section.order-summary__section--discount { display: none; }
To find the exact CSS selector use a browsers developer tools to inspect the html of the page.
https://stackoverflow.com/questions/4500572/how-can-i-get-the-css-selector-in-chrome
There's also a line-item-scripts to reject any discount-codes (idk why they labeled it "disable")
Though there are ways with checkout-scripts to hide shipping rates and hide payment methods in typical fashion there is no parity in having a checkout-script approach to hide the discount field in a similar way.
Good Hunting.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Others do not know what you know you have to communicate it always provide context for technical issues: Store url, example url, storefront password if applicable, theme name, apps used.
https://community.shopify.com/c/shopify-design/help-us-help-you/td-p/668159
If for the cart template if your using a discount app disable any cart discount fields in the app.
If not using an app, others need better specifics to see or reproduce the situation.
If for the checkout merchants cannot modify the checkout unless on the shopify PLUS enterprise plan.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Hi Paul,
Thanks for your response. Attached is the image of the discount code input field. The store is not using an app. Our store is Shopify Plus, but we have not upgraded to checkout extensibility yet. We have customizations through checkout.liquid. Thanks for your help!
This is an accepted solution.
A screenshot is useless for solutions needing reproduction and inspection.
Be aware checkout.liquid customizations are being depreciated next year
https://changelog.shopify.com/posts/the-checkout-liquid-theme-file-is-being-deprecated
If this is for checkout the main way to not have the discount field is to not have any manual discount codes in the store. Meaning using only automatic-discounts or checkout-scripts.
Beyond that the actual CSS varies and has to be maintained, read constantly monitored.
Be sure to make a backup and !important 💣read guidance on editing that template.
https://shopify.dev/docs/themes/architecture/layouts/checkout-liquid
Roughly target the discount form with something like following, but that actual CSS can be different because of the utter worthless selector soup shopify insists on rendering in in some cases.
#Form0 { display: none; }
/* or */
.order-summary__section.order-summary__section--discount { display: none; }
To find the exact CSS selector use a browsers developer tools to inspect the html of the page.
https://stackoverflow.com/questions/4500572/how-can-i-get-the-css-selector-in-chrome
There's also a line-item-scripts to reject any discount-codes (idk why they labeled it "disable")
Though there are ways with checkout-scripts to hide shipping rates and hide payment methods in typical fashion there is no parity in having a checkout-script approach to hide the discount field in a similar way.
Good Hunting.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025