I want to override the template file for backend Order view
I've checked template path and found that this file is called.
vendor/temando/module-shipping-m2/view/adminhtml/templates/sales/order/view/info.phtml
So to override I did following in my module
Vendor/Module/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="1.0.0"></module>
<sequence>
<module name="Magento_Wishlist"/>
<module name="Temando_Shipping"/>
</sequence>
</config>
app/code/Vendor/Module/view/adminhtml/layout/sales_order_view.xml
<?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">
<body>
<referenceContainer name="left">
<referenceBlock name="order_info">
<action method="setTemplate">
<argument name="template" xsi:type="string">Vendor_Module::info.phtml</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
</page>
And I've put info.phtml in the following path
app/code/Vendor/Module/view/adminhtml/templates/info.phtml
But still, it's not working, clear cache and all but still not taking above file.
What can be wrong?
Best Answer
I've repeated your steps and the override works for me.
Here's what i did:
Added
app/code/Vendor/Module/view/adminhtml/layout/sales_order_view.xml
to an existing moduleCopied the contents of
vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml
into a new templateapp/code/Vendor/Module/view/adminhtml/templates/info.phtml
:Ran the
setup:upgrade
command to clear all caches:Visited an order details page in the admin: http://www.example.test/admin/sales/order/view/order_id/18/key/29acbf64d18925d298b839dae9c432d2090ec92b3b175649bf3a98c69fae6b47/
It would appear that the problem therefore lies with the Temando extension. I would check to see if the above steps work after disabling the Temando extension.
If so, I would get in contact with Temando.