How to Override name.phtml File for Order, Invoice and Shipment in Magento 2

You can override the name.phtml file for the below files:
You can override for any of the files mentioned above.
In such a case, you first have to follow the method to override name.phtml file for order, invoice and shipment in Magento and then you can get values using further code as per your business requirement.
It is widely accepted that modifying the core functionality of default Magento 2 is inappropriate. Thus, it is highly recommended to override the file instead of modifying any core file.
Never miss Magento tips, tricks, tutorials, and news.

  • For Creditmemo
    •  sales_order_creditmemo_new.xml
    •  sales_order_creditmemo_updateqty.xml
    •  sales_order_creditmemo_view.xml
  • For Orders
    • sales_order_view.xml
  • For Invoice
    •  sales_order_invoice_new.xml
    •  sales_order_invoice_updateqty.xml
    •  sales_order_invoice_view.xml
  • For Shipment
    •  adminhtml_order_shipment_new.xml
    •  adminhtml_order_shipment_view.xml

That’s all!

Method to Override name.phtml File for Order, Invoice and Shipment in Magento 2

Thank you for subscribing.

Thank You.
Overriding name.phtml file can be considered as a frequently required task for a developer who wants customization in the order, invoice, and shipment in Magento 2.

Use the below code to override name.phtml file.
You can also refer to the relevant solution to override block, model, and controller in Magento 2 and override a phtml file using a custom module in Magento 2 that I posted earlier.
Use the below code in your .xml file located at Vendor/Module/view/adminhtml/layout
For instance, if a store owner requires to get the value or file in the invoice, shipment, or order view page of the admin panel that the customer added through a custom field or file uploader from an order page.
If you have any doubts in the above solution, just mention them in the Comments section below.
Feel free to share the post with fellow developers via social media.
Now you need to create name.phtml at Vendor/Module/view/adminhtml/templates/items/column

Get Weekly Updates

Something went wrong.

I’d be glad to help you out.
For example, I’ve override name.phtml file for sales_order_view.xml as shown below:




(based on 8 Reviews)