How to hide the discount code input field for specific users?

Topic summary

Goal: hide the discount code input at checkout for customers with a specific tag; requester couldn’t locate the field in theme code.

Context clarified: Store is on Shopify Plus, using checkout.liquid (not migrated to checkout extensibility). No discount app is in use. An image of the discount field was shared, but more technical context was requested.

Key constraints and updates:

  • checkout.liquid customizations are being deprecated next year; proceed carefully and back up before editing.
  • Checkout can be customized on Shopify Plus, but there’s no script-based parity to conditionally hide the discount field for specific customers.

Suggested approaches:

  • Remove manual discount codes (use automatic discounts or checkout scripts) to effectively avoid the discount field being used.
  • Use line-item scripts to reject/disable discount codes (blocking usage rather than hiding the field).
  • Hide the field via CSS in checkout.liquid (e.g., target the discount section or form), but exact selectors vary; identify them using browser dev tools. This approach hides the field globally and requires ongoing maintenance.

Status: No definitive solution for tag-based conditional hiding of the discount field was provided; discussion remains open pending more specifics and potential script logic for rejecting codes.

Summarized with AI on January 28. AI used: gpt-5.

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!

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.

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!

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 :bomb: 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”)

https://help.shopify.com/en/manual/checkout-settings/script-editor/examples/line-item-scripts#disable-discount-codes

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.

1 Like