I spent quite a while trying to work out how to remove the Recurring Profile and Billing Agreements links from the Customer Account navigation menu in Magento. There are plenty of blog posts and Magento forum topics describing how to comment out or even delete the appropriate lines in the billing_agreement.xml or recurring_profile.xml files like this…
[code]
<!– <reference name="customer_account_navigation" >
<action method="addLink" translate="label"><name>recurring_profiles</name><path>sales/recurring_profile/</path><label>Recurring Profiles</label></action>
</reference> –>
[/code]
However, like many other developers, here at Optimise Web, we use the local.xml method of configuring our layout. Therefore the above technique does not work. Neither does <action=”unsetChild”>.
After lots of digging, I eventually found the solution. Copy this file…
ROOT_DIRECTORY/design/frontend/base/default/template/customer/account/navigation.phtml
into your corresponding theme eg…
ROOT_DIRECTORY/design/frontend/default/YOUR_THEME/template/customer/account/
Look for the line…
[code]<?php $_count = count($_links); ?>[/code]
Change it to the following and upload it to your server…
[code]<?php $_count = count($_links); unset($_links["recurring_profiles"]); unset($_links["billing_agreements"]); ?>[/code]
And that’s it – job done. Simples!
Tested on Magento 1.5.1.0
Written by Adrian Hart
Topics: Magento