Reputation: 322
I’m having some trouble in my module, it is working fine in local server but it’s not working in dev server. Here is my code: app/etc/modules/Ecophone_Specialoffer.xml
<?xml version="1.0"?>
<config>
<modules>
<Ecophone_Specialoffer>
<active>true</active>
<codePool>local</codePool>
</Ecophone_Specialoffer>
</modules>
</config>
Config file app/code/local/Ecophone/Specialoffer/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Ecophone_Specialoffer>
<version>0.1.0</version>
</Ecophone_Specialoffer>
</modules>
<frontend>
<events>
<checkout_cart_product_add_after>
<observers>
<Ecophone_Specialoffer_Model_Observer>
<type>singleton</type>
<class>Ecophone_Specialoffer_Model_Observer</class>
<method>changingPrice</method>
</Ecophone_Specialoffer_Model_Observer>
</observers>
</checkout_cart_product_add_after>
</events>
</frontend>
</config>
Observer.php app/code/local/Ecophone/Specialoffer/Model/Observer.php
class Ecophone_Specialoffer_Model_Observer {
public function changingPrice(Varien_Event_Observer $obs){
die('hello');
}
}
I don't know what is gonna wrong in dev server.
Upvotes: 2
Views: 4850
Reputation: 183
Please Login to magento admin go to system->tools->compilation and click disable.
Now it will work in server.
Upvotes: 0
Reputation: 1
put your events code in
<global>
<!-- you event here -->
</global>
so it is like
<global>
<events>
<checkout_cart_product_add_after>
<observers>
<ecophone_specialoffer_model_observer>
<type>singleton</type>
<class>Ecophone_Specialoffer_Model_Observer</class>
<method>changingPrice</method>
</ecophone_specialoffer_model_observer>
</observers>
</checkout_cart_product_add_after>
</events>
</global>
This will solve your issue. regards Sukhwant
Upvotes: 0
Reputation: 2790
Check for difference between capital letters and downcase becouse Windows don't care about capital letter or not, but linux do. Check it.
Change:
<Ecophone_Specialoffer_Model_Observer>
To:
<ecophone_specialoffer_model_observer>
Upvotes: 2