0

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 :

app/code/Portail/Fournisseur/view/adminhtml/layout/sales_order_addcomment.xml

this is my path to my .tpl file

app/code/Portail/Fournisseur/view/adminhtml/templates/order/view/history.phtml

and this is my xml file :

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

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

app/code/Portail/Fournisseur/view/adminhtml/Magento_Sales/layout/sales_order_addcomment.xml

EDIT : I've also updated my module version

0

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">
    <sequence>
        <module name="Magento_Sales"/>
    </sequence>
</module>
| improve this answer | |

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.