3

I want to remove customer dashboard links. I have used below code and its working fine. But I want to know another way.

Please let me know if you have another logic to remove links.

Step 1: Go to (Package/Template/customer/account/navigation.phtml)

Step 2: Replace the below line

  $count = count($links);
  $_count = count($_links); /* Add or Remove Account Left Navigation Links Here -*/

  unset($_links['tags']); /* My Tags */
  unset($_links['invitations']); /* My Invitations */
  unset($_links['reviews']);  /* Reviews */
  unset($_links['wishlist']); /* Wishlist */
  unset($_links['newsletter']); /* Newsletter */
  unset($_links['orders']); /* My Orders */
  unset($_links['address_book']); /* Address */
  unset($_links['enterprise_customerbalance']); /* Store Credit */
Mohit Kumar Arora
  • 9,951
  • 7
  • 27
  • 55
Abhishek Gupta
  • 1,185
  • 8
  • 17
  • While it is possible with layout XML and you should do that if it works for you, there is also a useful extension that lets you configure the customer menu in the admin panel: https://github.com/integer-net/RemoveCustomerAccountLinks (it uses the same technique eventually) – Fabian Schmengler Jul 06 '15 at 13:12
  • You can use this free extension: http://www.magentocommerce.com/magento-connect/manage-customer-navigation-menu.html – Gerard de Visser Jan 12 '16 at 08:28

3 Answers3

5

Create a small module for this.follow the following steps

Step 1:Create a xml file in the app/etc/modules/Neo_CustomerNavigationLinks.xml

<?xml version="1.0" ?> 
<config>
    <modules>
        <Neo_CustomerNavigationLinks>
            <active>true</active> 
            <codePool>local</codePool> 
        </Neo_CustomerNavigationLinks>
    </modules>
</config>

Step 2: create a xml file in the app/code/local/Neo/CustomerNavigationLinks/etc/config.xml

<?xml version="1.0" ?> 
<config>
    <modules>
        <Neo_CustomerNavigationLinks>
            <version>0.0.1</version> 
        </Neo_CustomerNavigationLinks>
    </modules>
    <frontend>
        <layout>
            <updates>
                <customernavigationlinks>
                    <file>neo_customernavigationlinks.xml</file> 
                </customernavigationlinks>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <customer>
                <rewrite>
                    <account_navigation>Neo_CustomerNavigationLinks_Block_Account_Navigation</account_navigation> 
                </rewrite>
            </customer>
        </blocks>
        <helpers>
            <customernavigationlinks>
                <class>Neo_CustomerNavigationLinks_Helper</class> 
            </customernavigationlinks>
        </helpers>
    </global>
</config>

Step 3: Create app/code/local/Neo/CustomerNavigationLinks/Block/Account/Navigation.php

<?php
        /**
         * @author Pradeep Sanku
         */
        class Neo_CustomerNavigationLinks_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation
        {
            /**
             * Description : Unset the Link by name in the customer Navigation
             * @author Pradeep Sanku
             * @param Name of the link to be removed 
             * @return link is removed.
             */
            public function removeLinkByName($name)
            {
                unset($this->_links[$name]);
                return $this;
            }
        }
    ?>

Step 4: Create app/code/local/Neo/CustomerNavigationLinks/Helper/Data.php

<?php
        class Neo_CustomerNavigationLinks_Helper_Data extends Mage_Core_Helper_Abstract
        {

        }
    ?>

Step 5: Create app/design/frontend/base/default/layout/neo_customernavigationlinks.xml

<?xml version="1.0" ?> 
<layout>
    <customer_account>
        <reference name="customer_account_navigation">
            <action method="removeLinkByName">
                <name>tags</name> 
            </action>
            <action method="removeLinkByName">
                <name>invitations</name> 
            </action>
            <action method="removeLinkByName">
                <name>reviews</name> 
            </action>
            <action method="removeLinkByName">
                <name>wishlist</name> 
            </action>
            <action method="removeLinkByName">
                <name>newsletter</name> 
            </action>
            <action method="removeLinkByName">
                <name>orders</name> 
            </action>
            <action method="removeLinkByName">
                <name>address_book</name> 
            </action>
            <action method="removeLinkByName">
                <name>enterprise_customerbalance</name> 
            </action>
        </reference>
    </customer_account>
</layout>

Clear cache and see you have done.

for more information you can refer same article on my blog http://magento-online-tutorials.blogspot.in/2015/06/remove-customer-account-navigation.html

Pradeep Sanku
  • 9,236
  • 2
  • 41
  • 73
4

you can just use remove it with simple xml tag. which you can add it to your local.xml of your theme to remove dashboard link which should be like below

<customer_account>
         <reference name="left">
            <!--Unset the whole block then add back later-->
            <action method="unsetChild"><name>customer_account_navigation</name></action>
            <!-- if you don't want to add any link just skip below part -->
            <block type="customer/account_navigation" name="customer_account_navigation" before="-" template="customer/account/navigation.phtml"> 
            <action method="addLink" translate="label" module="customer"><name>account</name><path>customer/account/</path><label>Account Dashboard</label></action>
            </block>
        </reference>
</customer_account>
liyakat
  • 3,995
  • 7
  • 27
  • 35
0

you can use this extension to remove any customer link , all you have to do install extension Configure the extension under: System >> Configuration >> Customer Configuration >> Customer Account Links. Choose menu items, which should not be shown, save, clear cache.

https://github.com/integer-net/RemoveCustomerAccountLinks

sv3n
  • 11,657
  • 7
  • 40
  • 73
Zuby
  • 358
  • 3
  • 15