I want to remove tabs(invoice,credit memo,shipment) in sales order view using observer
My config.xml
file
<adminhtml_widget_container_html_before>
<observers>
<package_test_adminhtml_widget_container_html_before>
<class>test/observer</class>
<method>adminhtmlWidgetContainerHtmlBefore</method>
</package_test_adminhtml_widget_container_html_before>
</observers>
</adminhtml_widget_container_html_before>
My observer.php
public function adminhtmlWidgetContainerHtmlBefore($event)
{
$block = $event->getBlock();
if ($block instanceof Mage_Adminhtml_Block_Widget_Tabs) {
$block->removeTab('order_tab_info'); // I am trying information tab from sales order view but it doesn't work
}
}
Best Answer
Try this:
In config.xml use core_block_abstract_to_html_before instead adminhtml_widget_container_html_before
and replace your observer adminhtmlWidgetContainerHtmlBefore() with:
Note: Please don't try to remove sales order view current active tab, it will thrown below error: