I'm trying to override the template for the comment history of a order (the part next to the total of the order).

this is my path to layout .xml :


this is my path to my .tpl file


and this is my xml file :

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    <container name="root">
        <referenceBlock name="order_history">
            <action method='setTemplate'>
                <argument name='template' xsi:type='string'>Portail_Fournisseur::order/view/history.phtml</argument>

My module is enabled, i've done this :

  1. setup:upgrade
  2. setup:di:compile
  3. setup:static-content:deploy
  4. cache:clean
  5. cache:flush

A similar issue added /Magento_Sales, but not working either. I'm on magento 2


EDIT : I've also updated my module version

1 Answer 1


Solved :

Instead of override sales_order_addcomment.xml, I've override sales_order_view.xml and change to this :

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceBlock name="order_history">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Codedecorator_Learn::order/view/history.phtml</argument>

Also added this into my module :

<module name="Portail_Fournisseur" setup_version="1.0.0" active="true">
        <module name="Magento_Sales"/>

Following blog post will help you about the same


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.