cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to add the product to wish-list as a guest in Magento.

SOLVED

Not able to add the product to wish-list as a guest in Magento.

Not able to add the product to wishlist as a guest in Magento 1.9.3.2
Steps To Reproduce:
Navigate to any category or product details page.
Click the Add to Wishlist button, the user get's redirected to the login page.
After logging in the user is redirected to the customer account Wishlist page but the product is not added.
Note:
If I comment out the below line then it will work.
Mage::getSingleton('core/session')->renewFormKey(); in core/Mage/Customer/Model/Session.php

2 REPLIES

Re: Not able to add the product to wish-list as a guest in Magento.

Hello @umar

 

seems like magento 1 bug

 

you can do like this

 

https://github.com/OpenMage/magento-mirror/blob/magento-1.9/app/code/core/Mage/Wishlist/controllers/...

 

remove formkey validation while add to wishlist

 

 public function addAction()
    {
//comment it
       /* if (!$this->_validateFormKey()) {
            return $this->_redirect('*/*');
        }
*/
        $this->_addItemToWishList();
    }

Re: Not able to add the product to wish-list as a guest in Magento.

Hi @Sunil Patel,

Thanks for the solution, It worked for me.