2

In customer account dashboard there's a recent orders block, i tried to override it like this:

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

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

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

<h1> Success !! </h1>

Unfortunately, it's not working at all

0

Code is seems Ok. May be you need to depends Module at app/code/Test/SuccessPage/etc/module.xml.

<?xml version="1.0" encoding="utf-8" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Test_SuccessPage" setup_version="2.0.0">
    <!-- add this -->
        <sequence>
            <module name="Magento_Customer"/>
        </sequence>

    </module>
</config>
  • not working either – simple guy Oct 3 '17 at 7:50
  • Please share your full module? – Amit Bera Oct 3 '17 at 7:53
  • I have same issue. It's not working. – Magecode Apr 4 '18 at 5:43
0

Update code in your layout file.

=> Test/SuccessPage/view/frontend/layout/customer_account_index.xml :


<?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="customer_account_dashboard_top">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Test_SuccessPage::order/recent.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>
  • not working at all – simple guy Oct 3 '17 at 7:25
  • Did you cleared cache. It's working fine for me. – Sohel Rana Oct 3 '17 at 7:31
  • yes i already cleared cache, and static content deploy – simple guy Oct 3 '17 at 7:34
  • I see, I test using SR_Stackexchange. – Sohel Rana Oct 3 '17 at 7:36
  • so i should make layout.xml inside layout folder? – simple guy Oct 3 '17 at 7:51

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.