I have three custom module for best selling, new product and special product. When I click on add to cart button of these products, it will leads to empty cart page and showing message cart is empty. While in whole site add to cart working fine.

When I disable cache, I am able to add to cart from here. For this I have increased cookie lifetime, gave 777 permission to session folder but nothing helped me.

  • maybe issue in formkey Commented Feb 28, 2017 at 9:48
  • form key is same throughout the page @PrasantaHatui
    – user00247
    Commented Feb 28, 2017 at 9:53
  • this either formkey or cookie issue. Compare both the page where works and the page where not works. Commented Feb 28, 2017 at 10:02

1 Answer 1


try the following code to get the add to cart url. I think the issue is in the add to cart url.

$_productId = '166';
$_product = Mage::getModel('catalog/product')->load($_productId);
$_url = Mage::helper('checkout/cart')->getAddUrl($_product);
  • This has been already done, but issue is still same.
    – user00247
    Commented Feb 28, 2017 at 12:32
  • disable your 3 custom module and try one by one and debug them.
    – Tonmoy
    Commented Mar 1, 2017 at 9:59

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.