How to override wishlist sidebar file in my own module?
-
12-12-2019 - |
Question
I want to override sidebar.phtml file of wishlist module in my own module.
Please guide me.
Thanks,
Solution
I guess that you want to change sidebar.phtml
.
Create New Layout file at Custom Module:
for this case.You need to create a frontend layout file customwishlist.xml
from this custom module like this.
<?xml version="1.0" ?>
<config>
<modules>
<Amit_Custommodule>
<version>1.0.0</version>
</Amit_Custommodule>
</modules>
<!-- start of routers
-->
<frontend>
<layout>
<updates>
<custommodule>
<file>customwishlist.xml</file>
</custommodule>
</updates>
</layout>
</frontend>
</config>
Change template file at new layout file
then on customwishlist.xml
file using siderbar.phtml
name and using setTemplate
function set template .
<?xml version="1.0"?>
<layout version="0.1.0">
<!--
Default layout, loads most of the pages
-->
<default> <!-- wishlist_sidebar sidebar block name define at wishlist.xml -->
<reference name="wishlist_sidebar">
<action method="setTemplate"><template>youpath/customsider.phtml</template></action>
</reference>
</default></layout>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange