All things Shopify and commerce
Hi everyone,
I’m looking to create a mandatory discount field & checkbox with "i dont have discount code" field on the cart page of my Shopify store. Currently, my cart page doesn’t have a discount field at all.
Could someone guide me on how to implement this? Are there any specific steps or code snippets that can help achieve this functionality?
You mean the "discount code" field? It's only display in the checkout page rather than in the cart page.
If you want to add some field and checkbox to the cart page,
customise your theme,switch to edit code, edit the file "sections/main-cart-footer.liquid",
find the code
<div class="cart__ctas" {{ block.shopify_attributes }}>
and add below code after it
<input type="checkbox" required>i dont have discount code
Hi, Praja! If you still need help with this one, I've had a hand in developing this newly released app that let's you add a discount field almost anywhere you'd like in your theme! We currently don't have the functionality of making in mandatory, but that is something we could add if there's enough interest. Please give it a try and feel free to send me any feedback!
Discount Codes Anywhere!
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025