0

How to remove order history tab from magento2 admin sales order view page?

I am using the following code in sales_order_view.xml

<referenceBlock name="sales_order_tabs">
    <action method="removeTab">
        <argument name="name" type="xsi:string">order_history</argument>
    </action>
</referenceBlock>

But, i am getting the exception like

Exception: Warning: Illegal offset type in isset or empty in /vendor/magento/module-backend/Block/Widget/Tabs.php on line 479

2 Answers 2

0

I know this is an old question, but for someone who wants to remove the comments history tab, you need to add the following to your custom sales_order_view.xml file.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="sales_order_tabs">
            <action method="removeTab">
                <argument name="name" xsi:type="string">order_history</argument>
            </action>
        </referenceBlock>
    </body>
</page>
-1

you need to create customer_account.xml into your module or under theme

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer-account-navigation-orders-link" remove="true" />
    </body>
</page>
2
  • I wanted to remove the tab in admin sales view section. Commented Dec 7, 2017 at 7:51
  • @Sree Better do it via ACL , that is the right way if you want to hide the menu Commented Dec 7, 2017 at 7:57

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.