I need to add to wishlist ajax based or customer should not redirect to wishlist page with out redirect in Magento 2 environment.

anyone have suggestion please share.


Go for :Override this method Mage_Wishlist_IndexController::addAction() and replace this:

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

with this:


This is may not be a good way, however, you can override Magento\Wishlist\Controller\Index\Add. The custom execute method should return the Referer Url.

    return $resultRedirect;

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.