How to remove Recurring Profiles & Billing Agreements links from customer account navigation menu in Magento

Written by Adrian Hart

Topics: Magento

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…


<!-- <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> -->

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…

<?php $_count = count($_links); ?>

Change it to the following and upload it to your server…

<?php $_count = count($_links); unset($_links["recurring_profiles"]); unset($_links["billing_agreements"]); ?>

And that’s it – job done. Simples!

Tested on Magento 1.5.1.0

Leave a Comment Here's Your Chance to Be Heard!