Magento – Clear shopping cart event in magento

magentomagento-1.7

Can anyone tell me what is the right event to trigger when the user click clear shopping cart button.I want to remove some information on the basis of that event.Currently I am storing information on add to cart event using observer .Thanks

Best Answer

i recently implemented this in a custom module.

controller_action_predispatch_checkout_cart_updatePost

this event get calls exactly when pressed clear cart.

in the observer you can check if the method was called for empty cart:

$post = Mage::app()->getRequest()->getPost('update_cart_action'); // get value if ($post == 'empty_cart') { // perform logic $quote = Mage::helper('checkout/cart')->getQuote(); //quote $allQuoteItems = $quote->getAllItems(); // quote items // do code }

Hope it helps.

Related Topic