Why is my Add to Cart button is not working. It doesn’t happen all of the time. It seems to happen after browsing products and then selecting a different size once on the product page. This is a theme error, as I’ve disabled all of my website apps, etc.. I have also cleared my cache, cookies, and have tried in a private browser. Thank you!
Does it happen on slower networks/devices, or it does not matter?
Does it happen if you select variant quickly after page load or also if you wait a little?
I am able to kinda replicate it on slower connection if I select different variant as soon as I see the buttons. The problem I see can be fixed by one of these:
If you do not plan to offer pickup, change true to false at the end of this line:
Otherwise, replace defer="defer" with async on this line:
There is also an invalid HTML code, probably leftover from Printful App. Does not really break anything yet, but better to fix it for future sake:
<!-- PF EDT START -->
<script type='text/javascript'>var pfProductId = null;
var pfEdt = 1;
var pfEdtTextColor = null;
var pfEdtBackgroundColor = null;
var pfEdtBorderColor = null;
var pfEdtUseDefaultStyling = null;
var pfEdtTextAlignment = null;
var pfEdtFlags = { . . .
};<!-- PF EDT END -->
Either remove this code or add a </script> before <!-- PF EDT END -->.
Should be somewhere towards the end of layouts/theme.liquid
To add what @tim_tairli advised, it looks like the product-form.js is coming up with an error. I downloaded a fresh version of Taste theme, and I cannot replicate with my own products the problem on your site. I would suggest you install a new theme, remove anything and everything, including the bundle, and test it again.
Add to Cart issue is probably that the variant selector doesn’t update the active variant ID if you change sizes. Check your themes product javascript and make sure the data-variant-id is updated on selection. Test with console logs to see if the button is ever pointing to an invalid variant.