Can some one please point out the mistake in this observer example? I have been googling and searching all the day but all in vain Here is my code for the module in magento\app\etc\modules with the name of "Meteorify_Observerexample.xml".
<config>
<modules>
<Meteorify_Observerexample>
<codePool>local</codePool>
<active>true</active>
</Meteorify_Observerexample>
</modules>
</config>
Here is my code of "config.xml" in magento\app\code\local\Meteorify\Observerexample\etc
<?xml version="1.0"?>
<config>
<modules>
<Meteorify_Observerexample>
<version>0.0.2</version>
</Meteorify_Observerexample>
</modules>
<global>
<models>
<meteorifyobserverexample>
<class>Observerexample_Model</class>
</meteorifyobserverexample>
</models>
<events>
<sales_order_place_before>
<observers>
<Meteorify_Observerexample_Model_Observer>
<type>singleton</type>
<class>Meteorify_Observerexample_Model_Observer</class>
<method>example</method>
</Meteorify_Observerexample_Model_Observer>
</observers>
</sales_order_place_before>
</events>
</global>
</config>
Here is my code of "Observer.php" located in magento\app\code\local\Meteorify\Observerexample\Model
<?php
class Meteorify_Observerexample_Model_Observer {
public function example($observer) {
//$observer contains data passed from when the event was triggered.
Mage::log($observer);
Mage::log('We just made an Observer!');
echo "The event has been captured";
}
}
?>
I have also tried by deleting the cache and log the list of events being fired by adding the Mage::log($name, null, 'events.log', true); in Mage.php file and the selected event is being fired from there.But the observer is not getting called for the given event. Any hint or help will be highly appreciated. Thanks