Multiple modules overriding same core file in Magento

后端 未结 1 836
猫巷女王i
猫巷女王i 2020-12-29 11:54

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

相关标签:
1条回答
  • 2020-12-29 12:20

    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/

    0 讨论(0)
提交回复
热议问题