calling ajaxCart.add is extra... one way or another there will still be a post request
Form just make $_POST request to cart controller.
id_product comes from hidden input name id_product
quantity_wanted from input name qty
token from token
id_product_attribute is optional
XHRPOST : token=c6c7e968f90555586dc2a967c737c7&id_product=6433&qty=1&add=1&action=update
in theme JS already exists data-button-action click prevent defaults... so form not submitting as default post
all other mechanism you can see in /controllers/front/CartController.php
class CartControllerCore extends FrontController { /** @var string */ public $php_self = 'cart'; protected $id_product; protected $id_product_attribute; protected $id_address_delivery; protected $customization_id; protected $qty;
there is a simple and clear code, even with a descriptions