How to override order/history.phtml template in Magento 2?

You can override history.phtml file using layout XML by creating a module or directly add template file to the theme level under Magento_Sales module under the theme.

History.phtml file initiated by History.php Block class.

  • Using Theme level,


history.phtml file used for display list of Orders for a customer inside Customer Dashboard My Orders Section.

you can see My Orders page by URL, <SITE_URL>/sales/order/history

  • Using Module,

You need to create sales_order_history.xml file to add template,


Create history.phtml file,

Add Content from Sales Module history.phtml to your custom template and start modify based on your requirement.

Clear a cache and check your login page.