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 */
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>
  • Thanks liyakat, your solutions is also working and compact... – Abhishek Gupta Jan 7 '15 at 7:27
  • This does not prevent users from accessing the feature. The server-side needs to be locked down as well if the intent is to remove the functionality. – Luke A. Leber Jul 17 '16 at 18:13
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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.