Home > Blockchain >  AJAX Add to cart
AJAX Add to cart

Time:06-02

I've got an issue with AJAX add to cart button on single-product.php. By now everything works as it should, but with last woocommerce update i've got a problem with variable products.

Everything is fine on simple products, on variable i can also add product to cart, but unfortunetly there is no variation picked while all attributes is selected.

Here You got an example of issue: Product page.

If You add product to cart it will apear there, but as a simple product not variation.

I'm using X for Woocommerce plugin for swatches - when i disable it, everything works fine, but with no AJAX. I need it not only for swatches, but also minicart is powered by AJAX and after reloading page it doesn't work.

I hope someone could help me.

Best regards, Kuba

CodePudding user response:

Please check your DevTools console (F12). There are multiple errors about jQuery being not loaded and "add to cart" scripts mentioned.

I bet that hidden field containing the selected variation ID does not change when you select some variation because there is a problem with jQuery. It stays with the default value which is the parent product ID. So the parent product is added to your cart.

CodePudding user response:

There's a bug in WPML plug-in: https://wpml.org/errata/wp-6-0-issues-with-terms-assigned-to-posts,

pozdrawiam :)

  • Related