Question

I want to hide Edit button in Sales Order Section in magento as shown in below image-

enter image description here

Can anyone help me to hide this button.

Was it helpful?

Solution

You will need to use event adminhtml_widget_container_html_before

<global>
    <events>
        <!-- another events may be here -->
        <adminhtml_widget_container_html_before>
            <observers>
                <remove_edit_button>
                    <class>your_module/observer</class>
                    <method>removeEditButton</method>
                </remove_edit_button>
            </observers>
        </adminhtml_widget_container_html_before>
        <!-- another events may be here -->
    </events>
</global>

Now in your observer file create function as below

public function removeEditButton($observer)
{
    $container = $observer->getBlock();
    if (null !== $container && $container->getType() == 'adminhtml/sales_order_view') {
        $container->removeButton('order_edit');
    }
    return $this;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top