I am creating custom module for RMA(product return) in magento that's why I am trying to add a custom link "Return Request" in My Orders panel in customer account section as shown in below image-
For that I have created module "Assel_Rma" which have some files as below-
config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Assel_Rma>
<version>1.0.2</version>
</Assel_Rma>
</modules>
<frontend>
<routers>
<rma>
<use>standard</use>
<args>
<module>Assel_Rma</module>
<frontName>rma</frontName>
</args>
</rma>
</routers>
<layout>
<updates>
<rma>
<file>assel/rma.xml</file>
</rma>
</updates>
</layout>
</frontend>
<global>
<models>
<rma>
<class>Assel_Rma_Model</class>
</rma>
</models>
<blocks>
<rma>
<class>Assel_Rma_Block</class>
</rma>
<sales>
<rewrite>
<sales_order_history>Assel_Rma_Block_Sales_Order_History</sales_order_history>
</rewrite>
</sales>
</blocks>
<helpers>
<rma>
<class>Assel_Rma_Helper</class>
</rma>
</helpers>
</global>
</config>
frontend/base/default/layout/assel.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<sales_order_history translate="label">
<label>Customer My Account Order History</label>
<update handle="customer_account"/>
<reference name="my.account.wrapper">
<action method="setTemplate">
<template>rma/sales/order/history.phtml</template>
</action>
<block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/>
</reference>
<reference name="left">
<remove name="catalog.shopby"/>
<remove name="basenews"/>
<remove name="bestsales"/>
<remove name="left-block-banner-free"/>
<remove name="blogleft" />
</reference>
</sales_order_history>
</layout>
app/code/local/Assel/Rma/Block/Sales/Order/History.php
<?php
class Assel_Rma_Block_Sales_Order_History extends Mage_Sales_Block_Order_History
{
}
After doing all above now "My Orders" looks like as below-
In above image my sidebar gets doubled and nothing is shown on the page.
can anyone please help me to get rid out of this problem.
Best Answer
change rewrite code in xml
you have to set template from block as it is set in
Mage_sales_Block_Order_History
.