NEW -- Add Discount Field On Shopify Cart Without Apps [LATEST UPDATE]
Photo by James Harrison on Unsplash

NEW -- Add Discount Field On Shopify Cart Without Apps [LATEST UPDATE]


This Article is Originnaly Posted on Medium.

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 Or main-cart-footer.liquid. This varies from theme to another, try to identify the file in sections folder, it might be the word cart 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

NEW -- Add Discount Field On Shopify Cart Without Apps [LATEST UPDATE]

  • 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.


#Video Tutorial

#Video Demo


#Useful resources

So, this is the end of our article today, I hope you learned something from it.

Have a wonderful, great day. Don’t hesitate to contact me if you have any questions. If you face any issues with adding it, you can reach out to me.

Follow me for?more:



No alt text provided for this image
Buy Me a Coffee?
Gabriel Biron

Founder at Fenris Workshop

7 个月

Hi, You mention at the end of your article to change the JS selector, do you have steps available for that as well? Thank you

回复

要查看或添加评论,请登录

Mohamed El-Ghorfi的更多文章

社区洞察

其他会员也浏览了