Recently purchased the ‘Flow’ theme and the add to cart button and dynamic buy button aren’t working? Has anyone had this issue before?
Sorry you are facing this issue, it would be my pleasure to help you.
Welcome to the Shopify community! ![]()
Thanks for your good question.
Please share your site URL,
I will check out the issue and provide you a solution here.
I’m having the same issue, and I think I found the fix for my problem.
Problem: The add to cart button on PDP isn’t working. When you click it, it sends a request to /cart/add.js from onAddToCart() and there’s a 400 error. The add to cart button works on the home page, which uses functions other than onAddToCart(), so clearly that function is upset about something.
Solution: We just added the product id to the form, and it’s working now. Specifically, in template–product.liquid, under <div class="paymentButtonsWrapper">, we added <input type="hidden" name="id" value="{{ product.variants.first.id }}" />
I’m still confused as to how this problem arose; I don’t think our devs introduced it. I’m a little concerned that this might not work in the future if different variants are added to the products. Will need more testing.