尝试
创建:app/code/local/MagePal/MyCheckout/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<MagePal_MyCheckout>
<version>1.0.1</version>
</MagePal_MyCheckout>
</modules>
<global>
<models>
<magepal_mycheckout>
<class>MagePal_MyCheckout_Model</class>
</magepal_mycheckout>
</models>
<events>
<checkout_onepage_controller_success_action>
<observers>
<magepal_mycheckout>
<type>singleton</type>
<class>mycheckout/observer</class>
<method>sendEmail</method>
</magepal_mycheckout>
</observers>
</checkout_onepage_controller_success_action>
</events>
</global>
</config>
创建:app/code/local/MagePal/MyCheckout/Model/Observer.php
class MagePal_MyCheckout_Model_Observer
{
/**
*
* @param Varien_Event_Observer $observer
* @return object
*/
public function sendEmail(Varien_Event_Observer $observer)
{
//add logic here
return $this;
}
}
创建:app/etc/modules/MagePal_MyCheckout.xml
<?xml version="1.0"?>
<config>
<modules>
<MagePal_MyCheckout>
<active>true</active>
<codePool>local</codePool>
</MagePal_MyCheckout>
</modules>
</config>