Magento – How to update cart THEN proceed to checkout

javascriptquantityshopping-cart

End-users are the ultimate test subjects…

I'm noticing a trend with a small percentage of users in my store but still enough to lead to customer service calls when they can't solve the problem on their own. They are not hitting "update quantity" in the shopping cart before proceeding to checkout. The majority of users get it but I'm trying to completely side-step the phone calls by just having it automatically update the quantity THEN proceed to checkout.

The HTML containing the JS that triggers the update:

<a href="javascript:void(0);" class="update" onclick="return updateCart();">update</a>

I would like this event to happen when they hit Proceed to Checkout. Processing the onclick event returns Illegal return statement and the href link alone returns Undefined. Ideas?

Best Answer

you can write your cart update code in controller_action_predispatch_checkout_onepage_index event.

this event is dispatched when proceed to checkout button is clicked.

Related Topic