1

I am trying to write observer.for reference i am following below tutorial http://franklinstrube.com/blog/magento-event-observers/ . but my custom observer i not getting triggered. I am using Magento ver. 1.8.1.0 CE

my app/code/local/sv/ConnectInfusion/etc/config.xml file is as follows

<?xml version="1.0"?>
<config>
 <modules>
 <sv_ConnectInfusion>
 <version>1.0.0</version>
 </sv_ConnectInfusion>
 </modules>
 <global>
 <models>
 <ConnectInfusion>
 <class>sv_ConnectInfusion_Model</class>
 </ConnectInfusion>
 </models>
 <events>
 <checkout_submit_all_after>
 <observers>
 <awesome_example>
 <class>sv_ConnectInfusion_Model_Observer</class>
 <method>SyncWithInfusion</method>
 </awesome_example>
 </observers>
 </checkout_submit_all_after>
 </events>
 </global>
</config>

My Observer file is

app/code/local/sv/ConnectInfusion/Model/Observer.php

class sv_ConnectInfusion_Model_Observer {
 /**
 * This function is triggered by a Magento observer declared
 * in etc/config.xml
 *
 * @param Varien_Event_Observer $observer
 */
 public function SyncWithInfusion($observer)
 {
 // Your magic code goes here...
 $event = $observer->getEvent()->getControllerAction()->getFullActionName();
 Mage::log('Event Fired: ' . $event);
 Mage::log('yeah i am in observer !! it works' , null , 'mylog.log');
 die();
 }
}

and my app/etc/modules/sv_ConnectInfusion.xml file is as follows.

<?xml version="1.0"?>
<config>
 <modules>
 <sv_ConnectInfusion>
 <active>true</active>
 <codePool>local</codePool>
 <depends>
 <Mage_Checkout/>
 <Mage_Sales/>
 <Mage_CatalogInventory/>
 </depends>
 </sv_ConnectInfusion>
 </modules>
</config>

what i am doing wrong? I tried by changing the xml files, adding <depends> , i also tried to move the code in community directory but still no luck.

Marius
199k55 gold badges431 silver badges837 bronze badges
asked Jan 8, 2014 at 17:29
3
  • checkout_submit_all_after only appeared in Magento 1.4. What version are you running? Commented Jan 8, 2014 at 19:31
  • i am using Magento ver. 1.8.1.0 CE Commented Jan 9, 2014 at 5:42
  • Then find a event you want to use and use this, no event, no dispatching :D Commented Jan 9, 2014 at 6:47

2 Answers 2

2

Please change the moduleNamespace sv to Sv and change sv folder name to Sv

Also change model name to all lower-letter

<?xml version="1.0" ?>
<config>
 <modules>
 <Sv_ConnectInfusion>
 <version>1.0.0</version>
 </Sv_ConnectInfusion>
 </modules>
<global>
 <models>
 <connectinfusion>
 <class>Sv_ConnectInfusion_Model</class>
 </connectinfusion>
 </models>
 <events>
 <checkout_submit_all_after>
 <observers>
 <awesome_example>
 <class>Sv_ConnectInfusion_Model_Observer</class>
 <method>SyncWithInfusion</method>
 </awesome_example>
 </observers>
 </checkout_submit_all_after>
 </events>
</global>
</config>
answered Jan 9, 2014 at 13:57
4

checkout_submit_all_after is replicated for Magento CE 1.8x and you can use checkout_type_onepage_save_order_after event in Magento CE 1.8x

answered Jan 9, 2014 at 13:21
1
  • You sir have just saved my keyboard from a trip out of the window! Commented Oct 12, 2018 at 9:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.