How To Remove Any Links From Left Navigation In Magento My Account page

Some times it is very hard to find out and solve even simple issues too in a Magento project. Like renaming some texts removing unwanted links from the navigation area, today me too went through such a situation , one of my client doesn’t need few links from ‘My Account’ navigation from the customer dashboard  when a client is logged in.

He said me to remove the links like Billing agreements,My downloadable products,Recurring Profiles,My Applications and My Tags, so first I did this by editing each and every single file of that particular links.

That is, we can remove ‘Billing agreements’ link from billing_agreement.xml by commenting or removing below code from it,

<customer_account>
<reference name=”customer_account_navigation” >
<action method=”addLink” translate=”label”><name>billing_agreements</name><path>sales/billing_agreement/</path><label>Billing Agreements</label></action>
</reference>
</customer_account>

We can find billing_agreement.xml file from app/design/frontend/default/YOURTEMPLATE/layout/sales/

and we can remove  ‘My downloadable products’ link from downloadable.xml using the same method by commenting or removing below code from it,

<customer_account>
<reference name=”customer_account_navigation”>
<action method=”addLink” translate=”label” module=”downloadable”><name>downloadable_products</name><path>downloadable/customer/products</path><label>My Downloadable Products</label></action>
</reference>

</customer_account>

We can find billing_agreement.xml file from
app/design/frontend/default/YOURTEMPLATE/layout directory,

But it is too difficult to find each and every folder and edit the codes  , so here is a simple method that we can use to remove any links from magento customer my account navigation ,

For that we can use below simple code,

First go to app/design/frontend/default/YOURTEMPLATE/template/customer/account/navigation.phtml

and then find the line

 

 $_index = 1;
And add the below code under this line

$_count = count($_links); /* Add or Remove Account Left Navigation Links Here -unset($_links[‘OAuth Customer Tokens’]); /* My Applications
unset($_links[‘recurring_profiles’]); /* Recurring Profiles */
unset($_links[‘tags’]); /* My Tags */unset($_links[‘enterprise_customerbalance’]); /* Store Credit */
unset($_links[‘invitations’]); /* My Invitations */
unset($_links[‘enterprise_reward’]); /* Reward Points */
unset($_links[‘giftregistry’]); /* Gift Registry */
unset($_links[‘downloadable_products’]); /* My Downloadable Products */unset($_links[‘enterprise_giftcardaccount’]); /* Gift Card Link */
unset($_links[‘billing_agreements’]); /* Billing Agreements */

So just select the above code and disable the links that you didn’t need. Hope this trick will help you.

 

About Shino

Shino, the author of this blog is a 28 year old master graduate in Computer Science, a professional programmer and web developer. TechMagics.com is his humble venture to share whatever he knows and learns about programming,technology and web world.

2 thoughts on “How To Remove Any Links From Left Navigation In Magento My Account page

Leave a Reply