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,
app/design/frontend/{Vendorname}/{themename}/Magento_Sales/templates/order/info.phtml
  • 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="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Sales\Block\Order\Info" type="Jesadiya\Info\Block\Order\Info" />
</config>

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

<?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,

app/code/Jesadiya/Info/view/frontend/templates/order/info.phtml

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

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