I have created the custom ajax cart in magento,in that mini cart is updated without loading the page.But in that remove items link is not working,it is been redirecting to ajaxDelete action url(for eg:


Its not showing the confirm box.Code I have used for mini cart in controller is,

$mini_cart              = $this->getLayout()->getBlock('minicart_head');
$response['minicart']   = $mini_cart->toHtml();

in list.phtml I used,

if (jQuery('.header-minicart')){
        jQuery('.header-minicart').html( data.minicart );

Thanks in advance.

1 Answer 1


This may be form key issue.In ajaxDeleteAction() function,magento is check form key using below code:

   if (!$this->_validateFormKey()) {
        Mage::throwException('Invalid form key');
  • thanks for your comment.ok How can I rectify this issue. Commented Feb 5, 2015 at 13:57
  • @Sree not sure if you found the solution yet, but you need to send the form key in the URL to fix this issue. Commented Mar 31, 2017 at 5:51
  • @Sree - did you get any solution for this ? Commented Sep 1, 2017 at 5:31
  • @amit - is there any workaround for this issue ? Commented Sep 1, 2017 at 5:54
  • I will late you know at night
    – Amit Bera
    Commented Sep 1, 2017 at 5:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.