Categories

Featured templates

Magento. How to manage customer account dashboard links

Harry Baker February 26, 2016
Rating: 5.0/5. From 2 votes.
Please wait...
Magento. How to manage customer account dashboard links

This tutorial will teach you how to remove links from customer account navigation menu in Magento:

Magento. How to manage customer account dashboard links

The best approach is to make a small module and remove all these links from one xml file. To do so follow the steps below.

You can use any code editor available to create/edit the files mentioned (for example Notepad ++ ), we’re using hosting cpanel.

  1. Access the installation root of your site.

  2. Create xml file of the modulePrasan_CustomerNavigationLinks.xml‘ in app/etc/modules/ with the following code in it:
    <?xml version="1.0"?>
    <config>
    <modules>
    <Prasan_CustomerNavigationLinks>
    <active>true</active>
    <codePool>local</codePool>
    </Prasan_CustomerNavigationLinks>
    </modules>
    </config>
  3. Create the module config.xml file in app/code/local/Prasan/CustomerNavigationLinks/etc/ with the following code in it:
    <?xml version="1.0"?>
    <config>
    <modules>
    <Prasan_CustomerNavigationLinks>
    <version>0.0.1</version>
    </Prasan_CustomerNavigationLinks>
    </modules>
    <frontend>
    <layout>
    <updates>
    <customernavigationlinks>
    <file>prasan_customernavigationlinks.xml</file>
    </customernavigationlinks>
    </updates>
    </layout>
    </frontend>
    <global>
    <blocks>
    <customer>
    <rewrite>
    <account_navigation>Prasan_CustomerNavigationLinks_Block_Account_Navigation</account_navigation>
    </rewrite>
    </customer>
    </blocks>
    </global>
    </config>
  4. Access app/code/local/Prasan/CustomerNavigationLinks/ directory and create Block/Account/ path there. Now create there module block file ‘Navigation.php‘with the following code in it:
    <?php
    class Prasan_CustomerNavigationLinks_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation
    {
    /**
    * Description : Unset the Link by name in the customer Navigation
    * @author Author Name
    * @param Name of the link to be removed
    * @return link is removed.
    */
    public function removeLinkByName($name)
    {
    unset($this->_links[$name]);
    return $this;
    }
    }
  5. Now create prasan_customernavigationlinks.xml file in app/design/frontend/base/default/layout/ with the following content in it:
    <?xml version="1.0"?>
    <layout>
    <!-- Removes Customer Navigation Links from My Account -->
    <customer_account>
    <reference name="customer_account_navigation">
    <action method="removeLinkByName">
    <name>account</name> <!-- Removes Account Dashboard Link -->
    </action>
    <action method="removeLinkByName">
    <name>account_edit</name> <!-- Removes Account Information Link -->
    </action>
    <action method="removeLinkByName">
    <name>address_book</name> <!-- Removes Address Book Link -->
    </action>
    <action method="removeLinkByName">
    <name>orders</name> <!-- Removes My Orders Link -->
    </action>
    <action method="removeLinkByName">
    <name>billing_agreements</name> <!-- Removes Billing Aggrements Link -->
    </action>
    <action method="removeLinkByName">
    <name>recurring_profiles</name> <!-- Removes Recurring Profiles Link -->
    </action>
    <action method="removeLinkByName">
    <name>reviews</name> <!-- Removes My Product Reivews Link -->
    </action>
    <action method="removeLinkByName">
    <name>tags</name> <!-- Removes My Tags Link -->
    </action>
    <action method="removeLinkByName">
    <name>wishlist</name> <!-- Removes My Wishlist Link -->
    </action>
    <action method="removeLinkByName">
    <name>OAuth Customer Tokens</name> <!-- Removes My Applications Link -->
    </action>
    <action method="removeLinkByName">
    <name>newsletter</name> <!-- Removes Newsletter Subscriptions Link -->
    </action> <action method="removeLinkByName"> <name>downloadable_products</name> <!-- Removes My Downloadable Products Link --> </action> </reference> </customer_account> </layout>
  6. After you’re done, all the navigation links from customer account will be removed. To enable any link required, simply open prasan_customernavigationlinks.xml file and comment it out like this – <!-- <name>downloadable_products</name> -->.
  7. Now save the changes, clear magento cache and check the site.

That’s it! Now you know how to remove links from customer account navigation menu.

Feel free to check the detailed video tutorial below:

Magento. How to manage customer account dashboard links
Magento Premium Themes
This entry was posted in Magento Tutorials and tagged account, customer, dashboard, links, Magento. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket