I am currently trying to add an observer on a Magento Community 1.6.2.0
I am trying to add an observer to checkout_onepage_controller_success_action that checks the ordered products' SKU and performs additional code that creates and emails a Voucher code if the SKU is correct.
I can create and email the codes correctly when testing on another page, but every attempt to set the method as an observer have failed with no explanation.
in app/etc/modules/giftCheck_sales.xml
<?xml version="1.0"?>
<config>
<modules>
<giftCheck_sales>
<active>true</active>
<codePool>local</codePool>
</giftCheck_sales>
</modules>
</config>
in app/code/local/giftCheck/sales/etc
<?xml version="1.0"?>
<config>
<frontend>
<events>
<checkout_onepage_controller_success_action>
<observers>
<giftCheck_sales>
<type>singleton</type>
<class>giftCheck_sales/observer</class>
<method>exportOrder</method>
</giftCheck_sales>
</observers>
</checkout_onepage_controller_success_action>
</events>
</frontend>
</config>
in app/code/local/giftCheck/sales/models/observer.php
class giftCheck_sales_Model_Observer
{
public function exportOrder(Varien_Event_Observer $observer)
{
die('test');
}
}
My issue is no matter what I do, I can never get these observers to work. Regardless of what code I place in my observer it never gets executed.
What is the issue with (I presume my XML) the way I am setting up this observer?
Any help is greatly appreciated!