Add to cart button not working

Hi,

the “add to cart” buttons on our website www.yaxare.com don’t work. The issue is with the quick add buttons that we added in the theme code, but also with the original black buttons on the product page? But types of buttons seem to load, but they don’t connect to the cart. I recently exported our old website theme from another account and imported it here, but I’m not sure if this has anything to do with it. It only seems to be the cart buttons, all other buttons on the website work correctly.

Does anyone have any idea how to rectify this, and where in the code exactly? Help is much appreciated!

Best,

Chris

3 Likes

To fix this, the first step is to confirm whether the cart-related JavaScript is correctly included and running. This means checking if the theme still includes the correct files that handle Add to Cart actions. These scripts are often in the theme.js, cart.js, or global.js files.

We also want to inspect the buttons to make sure their HTML structure and data attributes match what the cart script expects. If the buttons were customized, you should review the custom code and compare it with Shopify’s current standards for dynamic cart updates. If the theme was built for a slightly older version of Shopify’s backend or storefront API, it might require slight updates to make everything work smoothly again.

Finally, after identifying and correcting any code or script issues, it’s good to test everything on both desktop and mobile to ensure it’s fully restored.

Hello @cweiri2
I just checked and the “Add to Cart” button is working. Could you please let me know on which theme or page it’s not working? If possible, please send the URL so I can take a better look.

I just checked it again. It’s working on mobile for me too, but on desktop (Chrome and Safari), the add cart buttons are just loading, but not opening. Here for example: https://yaxare.com/products/moringa-tea, and here: https://yaxare.com/products/the-female-tea

1 Like

Could you check using an incognito browser? It works on my end in both Safari and Chrome.

It’s working now. I had to clear all browser data in Safari and Chrome. Strange, because it happened in two different browsers at the same time. Thanks.

1 Like

Very welcome!