Beta 5: Add To Cart Button Reloading the Page and adding the URL parameter?

Hi!

This is a wired one. On a brand new install and on the pre-made Single product template, Add to cart button is performing normally, with the WooCommerce animation and without reloading the page.

However, On my staging website that is based on the existing shop, I have loaded my custom page template into the layout, trying to replace each part with the dynamic elements.

I have added the standard new Dynamic Add to cart button, but for some reason it is reloading the page and adding the ?add-to-cart=ID parameter.

My custom product page was reloading because I had to use the WooCommerce Add to cart url, which I don’t use anymore.

I am not sure if this is some Beta issue or I am doing something wrongly.

Thanks!

This was throwing me off too, but it looks like it follows the Enable Ajax settings in the Woo Settings (WooCommerce > Settings > Products)

image

I just turned that setting on, and it’s adding to cart without the redirect.

Thanks @devinelston Unfortunately, this setting is checked on the site, and it is still happening.

Weird. Out of curiosity I tried it on another test site, and un-checking that setting immediately triggered the Add to Cart button redirecting to ?add-to-cart= URLs. Re-checking it turned on the instant AJAX behavior… so I don’t know :man_shrugging:

Related to this AJAX setting, I’ve noticed a bug though. With the AJAX setting turned on, every time I select the Add To Cart button in the builder, it’s adding that product to my cart :rofl:

1 Like

Hey @Misho, let me know if there’s a URL where I can see this happening. I’m not able to reproduce it with AJAX cart turned on.

@devinelston, thanks! Fixed that for the next patch.

1 Like