how to create a discount field on cart page

how to create a discount field on cart page

praja
Shopify Partner
3 0 2

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?

Replies 2 (2)

whyshop
Shopify Partner
29 6 1

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

 

 

whyshop_0-1732174020261.png

 

Need a Shopify Specialist? Chat on WhatsApp
Contact iwhyshop@gmail.com for the solutions you need
Problem Solved? ✔Accept and Like solutions to help future merchants
Follow me on Facebook iwhyshop, Susbcribe to my YouTube iwhyshop.Author of app"Bulkite"-Bulk Price Editor App without product number limited

Josh-Bluedgeusa
Shopify Partner
5 0 7

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! 

Theme/App Developer - Discount Codes Anywhere WISER
- Apply Discount codes before checkout
- Decrease abandoned carts/increase AOV
- Supports multiple discounts