In cart page, when we change quantity of product, we want the Place Order button to change to Update Cart. When the page gets refreshed with chosen quantities when we click on Update Cart, then the button should become Place Order again.
Do you have an idea how to proceed for this scenario?
1 Answer
A simpler solution might be adding a JavaScript listener to the Qty boxes in the cart so that, when a value changes, it submits the form with id form-validate
. This submits to Magento\Checkout\Controller\Cart\UpdatePost
, with a default action of updating the shopping cart.
This would be much easier than switching the button back and forth, and would streamline the process for the user anyway since the cart would update automatically on entry of a new product quantity, without requiring an extra click.