What is the config required to rewrite a class that is already rewriting another class in magento?
For example, There is a community module doing the following:
<models>
<modulea>
<adminhtml>
<rewrite>
<session>CompanyA_ModuleA_Model_Adminhtml_Session</session>
</rewrite>
</adminhtml>
</modulea>
</models>
I want to rewrite the community module and I am trying the following code which is not working:
<models>
<moduleb>
<class>CompanyB_ModuleB_Model</class>
</moduleb>
<modulea>
<rewrite>
<adminhtml_session>CompanyB_ModuleB_Model_Adminhtml_Session</adminhtml_session>
</rewrite>
</modulea>
</models>
What is wrong with this
Be carefull at your rewrite XML syntax, you have an error. It should like :
and
Next you’ll need to extends the Good PHP class in the good order. FOr example if you want CompanyA extending/rewriting CompanyB :
CompanyA file :
CompanyB Model php file :
Last thing, to be sure that the rewrite is done in the good order (when doing a
Mage::getModel('adminhtml/session')you want to retrieve the CompanyB class and not the COmpanyA one), you’ll need to define which module depends on which. YOu do that in theapp/etc/modules/Company_Module.xmlfile.add for Company A :
add for Company B :