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

8 Comments Comments For This Post I'd Love to Hear Yours!

  1. Nick says:

    Works perfect!

    Magento 1.6.1.0

    Thanks

  2. Andrew says:

    This was the perfect solution.

    It should be noted that in my template file this directory did not exist (“ROOT_DIRECTORY/design/frontend/default/YOUR_THEME/template/customer/account/”) and I had to create it.

    Thanks for this solution!

  3. Jill says:

    Thanks so much! This is exactly what I was looking for. Much better than anything else I found about creating modules for the local.xml or just commenting it out! Worked perfectly in Magento CE 1.7.

  4. Jill says:

    Does anyone happen to know what the link name is for my applications? I’ve tried “applications”, “my_applications”, and “customer_token”.

    • skyzer says:

      Hello, inside foreach loop you can print out the name of each link.

      So, then u can see that it’s “OAuth Customer Tokens”
      That means you unset
      unset($_links[“OAuth Customer Tokens”]);

  5. Kathleen says:

    Easiest solution I found! Thank you! To remove my_applications, the name is OAuth Customer Tokens. FYI in case anyone needs it.

8 Comments Trackbacks For This Post

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

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