To Display Tracking information in the backend view for shipment, Magento 2 uses a order tracking view.phtml file from the Magento_Shipping module.
Full path: Magento/Shipping/view/adminhtml/templates/order/tracking/view.phtml
You can override view.phtml file using layout handle.
Magento uses the view template file at three different layout handle.
1. adminhtml_order_shipment_view.xml (Display track information in shipment page admin panel)
2. adminhtml_order_shipment_removetrack.xml (Delete Tracking info by click on Delete icon shipment page)
3. adminhtml_order_shipment_addtrack.xml (Add new Tracking from admin panel shipment page)
Create a simple module and override using below way,
1. adminhtml_order_shipment_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> <referenceBlock name="shipment_tracking"> <action method="setTemplate"> <argument name="template" xsi:type="string">Jesadiya_Tracking::order/tracking/view.phtml</argument> </action> </referenceBlock> </body> </page>
2. adminhtml_order_shipment_removetrack.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> <referenceBlock name="shipment_tracking"> <action method="setTemplate"> <argument name="template" xsi:type="string">Jesadiya_Tracking::order/tracking/view.phtml</argument> </action> </referenceBlock> </body> </page>
3. adminhtml_order_shipment_addtrack.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> <referenceBlock name="shipment_tracking"> <action method="setTemplate"> <argument name="template" xsi:type="string">Jesadiya_Tracking::order/tracking/view.phtml</argument> </action> </referenceBlock> </body> </page>
Create a Template file in your module with adminhtml folder.
Clear Cache and check the shipment page in the admin panel. Your template overrides with the core template file.