How to override order info.phtml template in Magento 2?

Order/info.phtml file display all the order information regarding the order.

If you need to override the info template with your module or theme level, you can do it with ease.

Template declaration will be found from the Block class, Magento\Sales\Block\Order\Info with protected $_template variable.

  • Theme level,

  • Module Level,

Create a frontend scope di.xml file to override block class,
Module name: Jesadiya_Info

Path: app/code/Jesadiya/Info/etc/frontend/di.xml

Create a Block class,
Path: app/code/Jesadiya/Info/Block/Order/Info.php

Create a template,

Add the content from the Original template with your modified changes.

clear Cache and check the order detail page in the frontend.

Leave a Reply