How to auto update Subtotal, Total in cart when I update product qty?
-
30-01-2021 - |
Pergunta
As when I change product qty in shopping cart, total
and subtotal
value must change without clicking on Update Shoping item
button
Solução
Magento 2 - Reload totals cart after ajax change quantity
- https://stackoverflow.com/questions/40002976/magento-2-reload-totals-cart-after-ajax-change-quantity?rq=1
- Shopping cart page, update quantity by ajax
- How to update cart qty using ajax Magento 2
- https://inchoo.net/magento-2/improve-usability-magento-2-add-cart-process/
Once the ajax process is complete, we can trigger scroll event to scroll on top of the page and as soon as mini-cart
get’s updated we can then trigger mini-cart
UI dialog to open and show us the complete experience and what mini-cart
is actually offering to us (either to go to the cart, go to the checkout or continue shopping).
Outras dicas
Just run the following js code -
require(
[
'Magento_Checkout/js/model/quote',
'Magento_Checkout/js/model/cart/totals-processor/default'
],
function(
quote,
totalsDefaultProvider
) {
totalsDefaultProvider.estimateTotals(quote.shippingAddress());
}
);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange