diff --git a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php index 1e37fc8a9..0ae107d8c 100644 --- a/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php +++ b/app/code/community/Nexcessnet/Turpentine/Model/Observer/Esi.php @@ -532,6 +532,9 @@ public function hookToControllerActionPreDispatch($observer) { if (Mage::helper('turpentine/data')->getVclFix() == 0 && $observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_cart_add') { Mage::dispatchEvent("add_to_cart_before", array('request' => $observer->getControllerAction()->getRequest())); } + if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'wishlist_index_index') { + Mage::dispatchEvent('wishlist_index_index_before', array('request' => $observer->getControllerAction()->getRequest())); + } } public function hookToControllerActionPostDispatch($observer) { @@ -552,4 +555,18 @@ public function hookToAddToCartAfter($observer) { $request = $observer->getEvent()->getRequest()->getParams(); //Mage::log("hookToAddToCartAfter ".print_r($request,true)." is added to cart.", null, 'carrinho.log', true); } + + /** + * Set the form key on the add to wishlist request + * + * @param $observer + * + * @return Nexcessnet_Turpentine_Model_Observer_Esi + */ + public function hookToAddToWishlistBefore($observer) + { + $key = Mage::getSingleton('core/session')->getFormKey(); + $observer->getEvent()->getRequest()->setParam('form_key', $key); + return $this; + } } diff --git a/app/code/community/Nexcessnet/Turpentine/etc/config.xml b/app/code/community/Nexcessnet/Turpentine/etc/config.xml index a9fc7eec1..5e814f690 100644 --- a/app/code/community/Nexcessnet/Turpentine/etc/config.xml +++ b/app/code/community/Nexcessnet/Turpentine/etc/config.xml @@ -468,6 +468,14 @@ + + + + turpentine/observer_esi + >hookToAddToWishlistBefore + + +