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
Works perfect!
Magento 1.6.1.0
Thanks
Nick, thanks for the confirmation about 1.6.1.0.
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!
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.
Does anyone happen to know what the link name is for my applications? I’ve tried “applications”, “my_applications”, and “customer_token”.
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”]);
Easiest solution I found! Thank you! To remove my_applications, the name is OAuth Customer Tokens. FYI in case anyone needs it.
Hi Kathleen, thanks for adding that! :)