0

When I overwrite a Model/Controller/Helper overwrite through <rewrite/> in my module, how can I do it such that the overriding of the classes is scoped within my module and those that declares <depends/> on my module?

So let's say I have moduleA, moduleB and moduleC.

I did a rewrite of Mage_Core_Catalog_Product and called it My_Test_Catalog_Product in moduleA.

moduleB <depends/> on moduleB in its module config file. So, I would like only moduleA and moduleB to have that rewrite effect. In other words, only moduleA and moduleB will read from My_Test_Catalog_Product while moduleC will remain status quo (reading from Mage_Core_Catalog_Product).

Currently, it seems like the effect of overwriting a core Model or Controller from my module is global in Magento.

2
  • Yes, class rewrites are global. I don't know, what you mean with "module scope" in this case, but here is a similar question: magento.stackexchange.com/questions/114540/… - but maybe there is a different solution to your problem, so if you update the question with some information on what you are trying to achieve and why you might get an answer. Aug 2, 2016 at 20:58
  • @fschmengler I've updated my question to elaborate on what I meant by module scope. Thanks!
    – xenon
    Aug 2, 2016 at 23:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.