Magento 2 – How to Remove Customer Account Dashboard Links

customer

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 */

Best Answer

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>
Related Topic