1

I have a Module that loads a whole bunch of Observers for a specific task on one theme. I've setup a mobile theme that doesn't need this specific module. How do I disable the module for that theme ?
I read the answers on Magento, how to disable module programmatically? that isn't really helpful for my case because I don't have any controllers in the module.

I am checking the Package name if (Mage::getSingleton('core/design_package')->getPackageName() == 'package') return true; but this doesn't work for the observed core_collection_abstract_load_after, it just crashes. So I want to not load anything at all to spare some processing time.

1 Answer 1

2

You cannot disable magento modules inside from magento, because they are already loaded when the observer-system is initialized.

What you can do is to disable your observers:

Mage::getConfig()->setNode('frontend/events/yourEventName/observers/yourObserverName/type', 'disabled');

This can be done in every event, especially in your core_collection_abstract_load_after

Sign up to request clarification or add additional context in comments.

1 Comment

Ok thank you very much, I think I will modify the original module

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.