2

I want to override sales order history for customer in frontend like this:

app/code/Test/SuccessPage/view/frontend/layout/sales_order_history.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="customer_account"/>
    <body>
        <referenceContainer name="content">
          <referenceBlock name="sales.order.history.extra.containe">
              <action method="setTemplate">
                  <argument name="template" xsi:type="string">Test_SuccessPage::order/history.phtml
              </action>
          </referenceBlock>
        </referenceContainer>
    </body>
</page>

app/code/Test/SuccessPage/view/frontend/templates/order/history.phtml

<h1> This is a test page </h1>

unfortunately the above code doesnt work at all, it still load the vendor history.phtml

3

Try following way:


<?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">
    <body>
        <referenceBlock name="sales.order.history">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Test_SuccessPage::order/history.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

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.