When I want to delete more than 1 product one by one from AJAX Cart , for 1st product its working fine but when I try to delete the another product the page it redirect to delete page URL like
(SiteURL/checkout/cart/delete/id/012/uenc/aHR0cDovLzEyMi)
and showing some json or html data like {"message":"Item was removed.","update_blocks":[{"key":".header .links","value":"<div class=\"links\"> ....
Delete Item From Shopping cart function deleteAction()
public function deleteAction() {
$id = (int) $this->getRequest()->getParam('id');
if ($id) {
try {
$this->_getCart()->removeItem($id)
->save();
} catch (Exception $e) {
$_response = Mage::getModel('ajaxcart/response');
$_response->setError(true);
$_response->setMessage($this->__('Cannot remove the item.'));
$_response->send();
Mage::logException($e);
}
}
$_response = Mage::getModel('ajaxcart/response');
$_response->setMessage($this->__('Item was removed.'));
//append updated blocks
$this->getLayout()->getUpdate()->addHandle('ajaxcart');
$this->loadLayout();
$_response->addUpdatedBlocks($_response);
$_response->send();
}
I will highly appreciate if i can get some help. Thanks in advance.