Hi guys, when I click the Add to Cart button, the product adds normally to the cart, but when I try to remove it or click the plus and minus buttons, the price doesn’t update. It just stays the same no matter what.
How can I fix this so the cart functions properly when I click plus/minus or remove an item?
You can either roll back your layouts/theme.liquid to older version, where the code highlighted on the screenshot looks like the one from the github link. Or, you can copy selected code from the gihub file and paste into your theme.liquid.
Make sure that you do not loose closing tags and do not create duplicate ones.
After you’ve saved the file, check once again that ticks are in place and every opening quote/apostrophe/tick has a closing pair.
However, it would be good to make a theme copy first as a backup – click 3-dot button next to your theme name and “Duplicate”
Hi @tim_1 I tried by editing the code with the one from github but still no luck….I’m not sure if I have the ‘automatically format liquid files on save’ checkbox unchecked, where can I find that? Thank you!
There are some errors.
This line has a semicolon at the end in your code, while it should not:
fetch(window.Shopify.routes.root + 'cart/change.js', { ...fetchConfig(), ...{ body } });
Also, your code uses change url, but original code uses update, probably not significant for this use case. I’d probably use code from the github unless there is a reason for this.
Since the code in this file does not run due to syntax error, there is a Javascript error in another file which depends on this one.
Fix the error above and let’s see how it goes then.