Module-conflicts-magento

As we all know there are a lot of companies and developers creating magento extensions and if you are using different third party extensions then you are more likely to have those conflicts as most of these modules are using Magento as base and extending Mage classes.

For example

If an extension rewrites or overrides the Mage Checkout Cart Model class like below

Class NameSpace1_ModuleName_Class_Name extends Mage_Checkout_Model_Cart

and another extension does the same then there is a conflict and Magento is going to run only one class unless we instruct Magento otherwise

Class NameSpace2_ModuleName_Class_Name extends Mage_Checkout_Model_Cart

To instruct Magento we need to use “DEPENDS” keyword when registering or creating NameSpace2_ModuleName.xml file in etc/modules directory as follows -:

<NameSpace2_ModuleName> <active>true</active> <codePool>local</codePool> <depends> <NameSpace1_ModuleName/> </depends>
</NameSpace2_ModuleName>

And you extend Namespace1_ModuleName class instead of Mage class like below -:

Class NameSpace2_ModuleName_Class_Name extends NameSpace1_ModuleName_Class_Name

Similar Posts