Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple modules overriding same core file in Magento

Tags:

magento

How does Magento handle multiple modules overriding the same core file? Is it possible? How is it done?

like image 594
swl1020 Avatar asked Feb 11 '13 15:02

swl1020


1 Answers

You have 3 choices for resolving conflicts:

  • Merge the code from one conflicting file into another and switch off the rewrite config.xml in one
  • Switch off the rewrite in one config.xml and then make the conflicting extension PHP file extend the other extension
  • Use the <depends> capability to make one extension depend on another. They will then rewrite in that order

Example (option # 2)

class A_Extension_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage

You would change it to:

class A_Extension_Model_Type_Onepage extends B_Extension_Model_Type_Onepage

Read more @ http://www.webshopapps.com/blog/2010/11/resolving-magento-extension-conflicts/

like image 144
Renon Stewart Avatar answered Oct 24 '22 09:10

Renon Stewart