Home Forums WoodMart support forum Bug with "Add to Cart" Ajax Button Behaviour Reply To: Bug with "Add to Cart" Ajax Button Behaviour

#320463

Thora
Participant

Hello,

below the reply from the plugin author, please note in particular the second paragraph, because the problem also affects other plugins that read the product selection fields. It would be really nice to get this worked.

Regarding the theme add to cart problem, they are correct that the extension submits the form itself. We change the action on the form with JavaScript and then submit it so we can capture all the fields that are present on the product page. We basically simulate exactly how the add to cart work but rather than allow WooCommerce to add the item to the cart, we add it to a cart like entity, the list.

The problem is the theme hooks into the form’s submit action. It should really only react to the button click from the add to cart button itself, rather than the form submit. There are other extension which do the same thing as Wishlists, submitting the form on the product page for our own purposes, such as a lot of the request a quote extensions.

My suggestion to them would be to check the form action to make sure it has not been altered by something else going on the site prior to capturing the submit and doing it via AJAX.