Tuesday, November 27, 2012

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,

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

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,

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>

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.

Kindly Bookmark this Post using your favorite Bookmarking service:
Technorati Digg This Stumble Stumble Facebook Twitter


Setu Bridge on November 27, 2012 at 8:55 PM said...

You have shared really such a nice information which is helped me so much and I think it will help to many other people.

magento development

Oren Bass on March 4, 2013 at 2:30 PM said...

Sometimes it is very boring for me to make changes this kind of errors or adding this codding after completion of client project of Magento Development. Even I also used this method.

Post a Comment

Related Posts Plugin for WordPress, Blogger...

Recent Posts

About Me

My Photo

Avid web coder | Blogger | Media fan | Martial Arts Trainer (I was :P ) | Founder of http://www.learnwebtipz.com

Recent Comments

| Learn Web Tips - A Blog For Learn And Discuss Web Tricks And Tips © 2012. All Rights Reserved | Template Style by My Blogger Tricks .com | Design by Brian Gardner | | Back To Top |