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
2 Answers 2
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 eithersimple guy– simple guy2017年10月03日 07:50:56 +00:00Commented Oct 3, 2017 at 7:50
-
Please share your full module?2017年10月03日 07:53:34 +00:00Commented Oct 3, 2017 at 7:53
-
I have same issue. It's not working.Magecode– Magecode2018年04月04日 05:43:47 +00:00Commented Apr 4, 2018 at 5:43
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 allsimple guy– simple guy2017年10月03日 07:25:13 +00:00Commented Oct 3, 2017 at 7:25
-
Did you cleared cache. It's working fine for me.Sohel Rana– Sohel Rana2017年10月03日 07:31:15 +00:00Commented Oct 3, 2017 at 7:31
-
yes i already cleared cache, and static content deploysimple guy– simple guy2017年10月03日 07:34:12 +00:00Commented Oct 3, 2017 at 7:34
-
I see, I test using SR_Stackexchange.Sohel Rana– Sohel Rana2017年10月03日 07:36:28 +00:00Commented Oct 3, 2017 at 7:36
-
so i should make layout.xml inside layout folder?simple guy– simple guy2017年10月03日 07:51:26 +00:00Commented Oct 3, 2017 at 7:51
Explore related questions
See similar questions with these tags.
customer_account_index.xmlfile