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

1 ACCEPTED SOLUTION

Accepted Solutions

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();
    }

Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

View solution in original post

3 REPLIES 3

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();
    }

Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

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.

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

Thanks for Saving My uncountable hours.