Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herveguetin/64f4b818407c03434f74 to your computer and use it in GitHub Desktop.
Save herveguetin/64f4b818407c03434f74 to your computer and use it in GitHub Desktop.
In Magento, when adding a product to wishlist, force redirection to wishlist page after customer login
<?php
// 1. Observe the following event: controller_action_predispatch_wishlist_index_add which calls, for example, the `forceReferer()` method
// 2. In your observer class, implement the `forceReferer()` method
/**
* When adding a product to wishlist,
* force redirection to wishlist page after customer login
*
*/
public function forceReferer(Varien_Event_Observer $observer)
{
Mage::getSingleton('customer/session')->setNoReferer(false);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment