I am using multiple event observers in Magento 1.9

From there, I want to conditionally execute other observers. For example, defining the configuration in system.xml to enable or disable execution of observers after certain events.

In config I have this:


Is there any configuration we can use here to enable/disable these observers?

1 Answer 1


Try this
In config.xml



public function addNewLayout($observer){
      $layout = $observer->getEvent()->getLayout();
      $update = $layout->getUpdate();

      $action = $observer->getEvent()->getAction();
      $fullActionName = $action->getFullActionName();

      switch ($fullActionName) {
        case 'adminhtml_sales_order_view':
            $xml = "<reference name='root'><remove name='footer'></remove></reference>";
//in case you're going to add some conditional (apply these new layout xml on these action or other things, you can modify it by yourself)

//here is the pieces of layout xml you're going to load (you get it from database)


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.