0

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.

Dhiren Vasoya
9,70914 gold badges37 silver badges61 bronze badges
asked Feb 28, 2017 at 9:47
3
  • maybe issue in formkey Commented Feb 28, 2017 at 9:48
  • form key is same throughout the page @PrasantaHatui 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

0

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);
answered Feb 28, 2017 at 10:15
2
  • This has been already done, but issue is still same. Commented Feb 28, 2017 at 12:32
  • disable your 3 custom module and try one by one and debug them. Commented Mar 1, 2017 at 9:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.