I am getting started with Magento (1.9) CE. I am trying to write a small module that amends the behavior of two models:
- Mage_Sales_Model_Quote
- Mage_Sales_Model_Quote_Address
I have created my classes MyCompany_Sales_Model_Quote and MyCompany_Sales_Model_Quote_Address that extends those classes.
My folder structure looks like
MyCompany
-> etc
-> config.xml
->Sales
-> Model
-> Quote.php
-> Quote
-> Address.php
I have verified that:
My module - MyCompany_Sales - shows up in Admin portal (Admin->System->Configuration->Advanced->Advanced)
If I don't write custom module and simply copy those files from Magento core and copy under Local->Mage->Sales->Model, the changes seems to work. But I would like to keep a module to only change the behavior which I want to.
I have to come conclusion that the main problem is that the system is not picking up my new classes correctly. Here is my config xml to override those classes:
< ?xml version="1.0"?>
<config>
<modules>
<MyCompany_Sales>
<version>0.1.0</version>
</MyCompany_Sales>
</modules>
<global>
<models>
<sales>
<rewrite>
<quote>MyCompany_Sales_Model_Quote</quote>
<quote_address>MyCompany_Sales_Model_Quote_Address</quote_address>
</rewrite>
</sales>
</models>
</global>
</config>
Any pointers on what I might be doing wrong would be greatly appreciated.