New element: add to cart button Ajax and quantity Ajax

I created a WooCommerce product page for grouped products.

To customize it, I created my own cards.

The problem is that I can’t use the “add to cart” element because it displays the grouped items.

So I created a quantity element that takes stock into account and a button to add them to the cart, but I lose the AJAX functionality; the mini-cart doesn’t open, and if I refresh the page, I add the products to the cart again.

It would be useful to create two new elements:

  1. An “add to cart” element that doesn’t take into account the product page it’s on, and therefore won’t display the grouped products, but this one would be AJAX-enabled.

  2. A “quantity” element to which the CSS class of the “add to cart” button would need to be added to link them. This would offer several quantity display options. When this item is used in the cart, it updates the cart via AJAX (no need to add the “update cart” button).

1 Like