Magento – SUPEE 7405: Frontend Cart Delete Action (Doesn’t Work)

magento-1.7magento-1.9PHPsupee-7405

After SUPEE 7405 installation, when using AJAX product delete action, it throws an error "Cannot remove the item." This message is due to added FORM-KEY validation into app/code/core/Mage/Checkout/controllers/CartController.php

Now, the question is: How to fix this issue? I've received comments saying I need to add a FORM-KEY to .phtml file responsible in ajax. But I DO NOT know which code to insert or file exactly I need to edit.

Any help?

Best Answer

I have it working by using the following as my deleteURL:

echo Mage::getUrl('checkout/cart/delete', array('id' => $item->getId()))
    . "form_key/" . Mage::getSingleton('core/session')->getFormKey();

Hope this helps someone

Related Topic