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

<?xml version="1.0"?>
<config xmlns:xsi=""
    <preference for="Magento\Sales\Block\Order\Info" type="Jesadiya\Info\Block\Order\Info" />

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

namespace Jesadiya\Info\Block\Order;

use Magento\Sales\Block\Order\Info as SalesInfo;

class Info extends SalesInfo
     * @var string
    protected $_template = 'Jesadiya_Info::order/info.phtml';

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.