Add Discount Field On Shopify Cart Without Apps [NEW]
Many of you has read my previous article regarding adding Discount Field On Shopify Cart Without using an application (Below the link if you haven’t read it yet).
Later on, Shopify released a new update changes on how they handle their checkout, that’s why for some stores that method couldn’t work. I am sharing with you today a new way that will work for these stores.
For more details, read my other article.
The first thing we need to do is to locate the liquid file that contains the code of your cart page.
#Locate Cart Template
- From your Shopify admin, go to Online Store > Themes.
- Find the theme you want to edit, and then click Actions > Edit code.
- In the Sections directory, click
cart-template.liquid
Ormain-cart-footer.liquid
. This varies from theme to another, try to identify the file in sections folder, it might be the wordcart
mentioned on it. Else you can reach out, I can help you to identify it with you. - Copy/paste the code below anywhere you want to add the discount input to your cart.
{% render 'snippet-gf-discount-code-updated' %}
#Create Snippet File

- On the popup, type the name ‘
snippet-gf-discount-code-updated
’ as below - Copy the code below or from here and paste it into the files we’ve just created in the previous step.
That’s it, now you can go to the cart page and test your discount form.
One last thing you need to do, on the JS code, change the totalCartSelector
to match your theme.
PS: If this method doesn’t work for your store, try the other method I shared before. Else, you can reach out to me, so I can help you!
Again, this is just to make it work for you, you can still refactor the code and adapt it to your needs.