When clicking on the add to wishlist button, I want to remain on the same page & perform the add function without redirecting to the wishlist page - is this possible?


You need to rewrite the method _addItemToWishList from the controller Mage_Wishlist_IndexController and replace the last line.
Instead of

$this->_redirect('*', array('wishlist_id' => $wishlist->getId()));

You have to put:



Here is an example on how you can rewrite a controller.
You need to rewrite (like I said) Mage_Wishlist_IndexController. The controller is found in app/code/core/Mage/Wishlist/controllers/IndexController.php.

| improve this answer | |
  • hi boss, thanks a lot for helping me again , again & again.... please tell me which in which folder and file..?... – Baby in Magento Mar 5 '15 at 7:40
  • 1
    @BabyinMagento2 See my edit. – Marius Mar 5 '15 at 7:42
  • ultimate you are ,as always..... – Baby in Magento Mar 5 '15 at 7:43
  • i will copy app/code/core/Mage/Wishlist/controllers/IndexController.php. and do changes here : app/code/Local/Mage/Wishlist/controllers/IndexController.php. – Baby in Magento Mar 5 '15 at 7:46
  • Not working for me...Any Suggestions? – Akshay Taru May 23 '15 at 14:03

What you're looking for is an Ajax solution. There are many extensions available to implement this for you, here are a few examples:

Alternately, if you'd like to implement it yourself, here is a guide:

Excellence Magento Blog - Ajax Based Add Product to Wishlist and Compare Products

This includes an extensive walkthrough on implementing this feature - as well as the module attached.

| improve this answer | |
  • will this extension work for 1.9 vwersion? – Baby in Magento Mar 5 '15 at 6:36
  • 1
    I don't see why not, although neither extension explicitly states that they support 1.9 . Try it on your staging environment and let us know. – Moose Mar 5 '15 at 7:00
  • thanks i will try , did you used any of above extension? any side effects did you faced? – Baby in Magento Mar 5 '15 at 7:16
  • 1
    I have not, no. That's why it's best to always test any extension on a staging environment. Both of the extensions listed though are well reviewed & have a decent user base. Read through the reviews. – Moose Mar 5 '15 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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