-
-
Save nhp/42b553e00c3366bedeeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<config> | |
<frontend> | |
<events> | |
<controller_action_predispatch_checkout_cart_add> | |
<observers> | |
<extra_static> | |
<type>singleton</type> | |
<class>extra_static/observer</class> | |
<method>controllerActionPredispatchForceValidFormKey</method> | |
</extra_static> | |
</observers> | |
</controller_action_predispatch_checkout_cart_add> | |
<controller_action_predispatch_wishlist_index_add> | |
<observers> | |
<extra_static> | |
<type>singleton</type> | |
<class>extra_static/observer</class> | |
<method>controllerActionPredispatchForceValidFormKey</method> | |
</extra_static> | |
</observers> | |
</controller_action_predispatch_wishlist_index_add> | |
</events> | |
</frontend> | |
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class Extra_Static_Model_Observer | |
* | |
* @category Model | |
* @package Extra_Static | |
* @author AOE Magento Team <[email protected]> | |
* @license none none | |
* @link www.aoe.com | |
*/ | |
class Extra_Static_Model_Observer | |
{ | |
/** | |
* forces the correct form_key | |
* | |
* @param Varien_Event_Observer $observer The varien event observer | |
* @return void | |
*/ | |
public function controllerActionPredispatchForceValidFormKey(Varien_Event_Observer $observer) | |
{ | |
$observer->getControllerAction()->getRequest()->setParam('form_key', Mage::getSingleton('core/session')->getFormKey()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment