I'm following https://ranasohel.me/2015/10/02/how-to-overwrite-sales-view-order-phtml-file-in-magento2/

I would like to override magento\vendor\magento\module-shipping\view\adminhtml\templates\order\view\info.phtml

How to do this?


One of the easiest way is that we will create a new backend admin: How to enable custom admin theme in Magento 2.


The second way, set our custom template


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

Load custom module layout after shipping


        <module name="Magento_Sales"/>
  • Does is need to create new theme for this? Can't we override with Magento Default Backend Theme? – Ankit Shah Nov 30 '16 at 2:39
  • It depends on your need. If you don't need to create a custom theme, we can choose the second. – Khoa TruongDinh Nov 30 '16 at 2:41
  • 1
    Ok I'm using Second Way. sales_order_view.xml is <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" 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">Custom_Module::order/view/info.phtml</argument> </action> </referenceBlock> </body> </page> Where to put sequence code? – Ankit Shah Nov 30 '16 at 2:43
  • In etc/module.xml – Khoa TruongDinh Nov 30 '16 at 2:45
  • So my module.xml will be <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Custom_Module" setup_version="1.0.1"> <sequence> <module name="Magento_Shipping"/> </sequence> </module> </config> – Ankit Shah Nov 30 '16 at 3:07

I've faced the same issue if i refrence to order_info block, you need to reference to order_shipping_view block instead


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


<h1> Override Success </h1>
<h2> Put Your desire content here </h2>

flush magento cache, do setup:upgrade

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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