I would like to add a function in Mage_Sales_Helper_Data without editing or copy of the original file. So I try to extend it, but this code doesn't work
I have created a config.xml in this folder app\code\local\ML\etc
<?xml version="1.0"?>
<config>
<modules>
<ML_Sales>
<version>0.0.1</version>
</ML_Sales>
</modules>
<global>
<helpers>
<sales>
<rewrite>
<data>ML_Sales_Helper_Data</data>
</rewrite>
</sales>
</helpers>
</global>
</config>
And then in app\code\local\ML\Sales\Helper I have created Data.php
<?php
require_once('Mage/Sales/Helper/Data.php');
class ML_Sales_Helper_Data extends Mage_Core_Helper_Data {
public function getOrderHistoryUrl()
{
return $this-> _getUrl('sales/order/history');
}
}
?>
Finally into my app\design\frontend\my_package\default\layout\local.xml
I wrote this code for get the link of "My Order" on my account navigation
<reference name="top.links">
<action method="addLink" translate="label" module="sales">
<label>Orders</label>
<url helper="sales/getOrderHistoryUrl"/>
<title>My Orders</title><prepare/>
<urlParams/>
<position>50</position>
</action>
</reference>
and also in app\etc\modules
<ML_Sales>
<active>true</active>
<codePool>local</codePool>
</ML_Sales>
What is wrong? Can someone please help me?