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


Solved :

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

<block class="Magento\Sales\Block\Adminhtml\Order\View\History" name="order_history" template="Portail_Fournisseur::order/view/history.phtml"/>

Also added this into my module :

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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