2

We have to override vendor adminhtml file in magento2.

\magento\module-sales\view\adminhtml\templates\order\view\info.phtml

Does anyone know how can i do this?

Thanks

1

You need to create custom module for that :

Try following way:

Create sales_order_view.xml at

app/code/Your_VendorName/Your_ModuleName/view/adminhtml/layout/sales_order_view.xml

Add below code in sales_order_view.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="order_info">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Vendor_Module::order/view/info.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

Then Copy info.phtml file from

vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml

To

app/code/Your_Vendor/Your_Module/view/adminhtml/templates/order/view/info.phtml

  • @AlinLupoiu Happy to help !! Keep helping :) – Manthan Dave Aug 23 '17 at 13:44
3

Method 1

You can create your module and place this file in

app/code/Namespace/Modulename/view/adminhtml/layout/sales_order_view.xml

And then add this code

<referenceBlock name='order_info'>
  <arguments>
    <argument name='template' xsi:type='string'>Namespace_Modulename::order/view/info.phtml</argument>
  </arguments>
</referenceBlock>

and then create the template phtml file and place your code there.

app/code/Namespace/Modulename/view/adminhtml/templates/order/view/info.phtml

Method 2

Another easy method is by placing the file in

app/design/adminhtml/Vendor/ThemeName/Magento_Shipping/templates/order/view/info.phtml

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