7

In /customer/account there are several links

  • account dashboard
  • account information
  • addressbook
  • etc

I do not have any need (as far as i can tell) for:

  • recurring profiles
  • my applications
  • my downloadable products (or I must be needing this when using gift card module, I don't know yet)

Where can I turn these off? It should be update proof ;-)

10

An alternative approach to Amit's is in your theme's local.xml to replace the parent block customer_account_navigation completely and then only add the links you want to show. Use the below and then delete the lines you don't want. Please note that if in the future any other links need to be added you would need to copy them into your local.xml to show up. As an extra benefit you can easily reorder the items.

<?xml version="1.0"?>
<layout version="0.1.0">
    <customer_account>
        <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>
                <action method="addLink" translate="label" module="customer"><name>account_edit</name><path>customer/account/edit/</path><label>Account Information</label></action>
                <action method="addLink" translate="label" module="customer"><name>address_book</name><path>customer/address/</path><label>Address Book</label></action>                    
                <action method="addLink" translate="label" module="downloadable"><name>downloadable_products</name><path>downloadable/customer/products</path><label>My Downloadable Products</label></action>                    
                <action method="addLink" translate="label" module="newsletter"><name>newsletter</name><path>newsletter/manage/</path><label>Newsletter Subscriptions</label></action>                    
                <action method="addLink" translate="label" module="review"><name>reviews</name><path>review/customer</path><label>My Product Reviews</label></action>                    
                <action method="addLink" translate="label" module="sales"><name>orders</name><path>sales/order/history/</path><label>My Orders</label></action>
                <action method="addLink" translate="label" module="tag"><name>tags</name><path>tag/customer/</path><label>My Tags</label></action>
                <action method="addLink" translate="label" module="wishlist" ifconfig="wishlist/general/active"><name>wishlist</name><path>wishlist/</path><label>My Wishlist</label></action>
                <action method="addLink" translate="label" module="oauth">
                    <name>OAuth Customer Tokens</name>
                    <path>oauth/customer_token</path>
                    <label>My Applications</label>
                </action>                    
        </block>
    </customer_account>
</layout>
  • Simple to use and does not required any installation. Nice work. Upvoted – Aakash Jan 14 '17 at 12:59
4

Just do this in your local.xml

<customer_account>
    <reference name="customer_account_navigation" >
            <!-- remove the link using your custom method -->
            <action method="removeLinkByName"><name>recurring_profiles</name>   </action>
            <action method="removeLinkByName"><name>billing_agreements</name></action>
            <action method="removeLinkByName"><name>reviews</name></action>
            <action method="removeLinkByName"><name>downloadable_products</name></action>
            <action method="removeLinkByName"><name>OAuth Customer Tokens</name></action>

            <action method="removeLinkByName"><name>account</name></action>
            <action method="removeLinkByName"><name>account_edit</name></action>
            <action method="removeLinkByName"><name>address_book</name></action>
            <action method="removeLinkByName"><name>orders</name></action>
            <action method="removeLinkByName"><name>tags</name></action>
            <action method="removeLinkByName"><name>wishlist</name></action>
            <action method="removeLinkByName"><name>newsletter</name></action>

    </reference>
</customer_account>

Delete the links you want to keep. :-)

  • This did not work for me. Resulted an error. – Webninja Aug 8 at 10:22
3

Magento is add link on customer account left hand side using addLink function on Mage_Customer_Block_Account_Navigation here

public function addLink($name, $path, $label, $urlParams=array())
{
    $this->_links[$name] = new Varien_Object(array(
        'name' => $name,
        'path' => $path,
        'label' => $label,
        'url' => $this->getUrl($path, $urlParams),
    ));
    return $this;
}

Magento add those link by this xml code

<action method="addLink" translate="label" module="customer"><name>account</name>

<path>customer/account/</path><label>Account Dashboard</label></action>

Most easy Process

there lot of layout xml file like tag.xml,outh.xml,customer.xml,checkout.xml

are which is included there link on left navigation using addLink function .If your layout folderapp/design/frontend/your package/your template/layout/ did not have those files but it links are available at your account left navigation then according to magento fallback logic need to copy those from app/design/frontend/base/default/layout/ to app/design/frontend/your package/your template/layout/.

Then comment this code those file.

to go your layout xmls file find <action method="addLink" code and remove those code

Right Process Using local.xml

Create an method on Mage_Customer_Block_Account_Navigation on remove the link using below code

public function removeLink($removename)
{
    unset($this->_links[$removename]);
    return $this;
}

You need to create an extension for this

Step1: Rewrite class Mage_Customer_Block_Account_Navigation using class Amit_RemoveNavigation_Block_Customer_Account_Navigation

Create a file Navigation.php at app\code\local\Amit\RemoveNavigation\Block\Customer\Account

<?php
class Amit_RemoveNavigation_Block_Customer_Account_Navigation extends Mage_Customer_Block_Account_Navigation
{
    public function removeLink($removename)
    {
        unset($this->_links[$removename]);
        return $this;
    }
}

Step2: create config.xml at app\code\local\Amit\RemoveNavigation\etc and

<?xml version="1.0"?>
<config>
  <modules>
    <Amit_RemoveNavigation>
      <version>1.0.0</version>
    </Amit_RemoveNavigation>
  </modules>
  <global>
    <helpers>
      <removenavigation>
        <class>Amit_RemoveNavigation_Helper</class>
      </removenavigation>
    </helpers>
    <blocks>
      <removenavigation>
        <class>Amit_RemoveNavigation_Block</class>
      </removenavigation>
            <customer>
                <rewrite>
                    <account_navigation>Amit_RemoveNavigation_Block_Customer_Account_Navigation</account_navigation>
                </rewrite>
            </customer>
    </blocks>
  </global>
</config> 

Step3: create helper class for this module Data.php at app\code\local\Amit\RemoveNavigation\Helper

<?php
class Amit_RemoveNavigation_Helper_Data extends Mage_Core_Helper_Abstract
{
}

Step4: create modules control file Amit_RemoveNavigation.xml at app/etc/modules/

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

You will see at outh.xml this code

  <reference name="customer_account_navigation">
        <action method="addLink" translate="label" module="oauth">
            <name>OAuth Customer Tokens</name>
            <path>oauth/customer_token</path>
            <label>My Applications</label>
        </action>
    </reference>

which is add on my applications link on left navigation

so create local.xml at app/design/frontend/your package/your template/layout/

add this code

<?xml version="1.0"?>
<layout version="0.1.0">
       <reference name="customer_account_navigation">
            <action method="removeLink" translate="label" module="oauth">
                <name>OAuth Customer Tokens</name> <!-- remove by name -->
            </action>
        </reference>
</layout>

You will see the below code at downloadable.xml

<customer_account>
        <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>
        </reference>
    </customer_account>

As i told i have add remove the link by tag <name>downloadable_products</name>so add local.xml code i look like

<?xml version="1.0"?>
<layout version="0.1.0">
       <reference name="customer_account_navigation">
            <action method="removeLink" translate="label" module="oauth">
                <name>OAuth Customer Tokens</name> <!-- remove by name -->
            </action>
       <action method="removeLink" translate="label" module="oauth">
                <name>downloadable_products</name> <!-- remove by name -->
            </action>

    </reference>
</layout>

In magento add this by

this tag according to your logic

<name>recurring_profiles</name>   
<name>billing_agreements</name>
<name>reviews</name>
<name>downloadable_products</name>
<name>OAuth Customer Tokens</name>

<name>account</name>
<name>account_edit</name>
<name>address_book</name>
<name>orders</name>
<name>tags</name>
<name>wishlist</name>
<name>newsletter</name>
  • Wow thats a big difference with the first answer... what makes this better (or worse?) – carlo Nov 9 '14 at 18:01
  • calro,this function removeLinkByName is not find in msgento 1.9 – Amit Bera Nov 9 '14 at 18:07
  • ah ok, clear... i'm going to try your method... is it safe to do? – carlo Nov 9 '14 at 18:09
  • please see update – Amit Bera Nov 9 '14 at 18:18
0

In CE 1.9.3 you can do the following:

1st remove the account navigation block entirely:

<!--Unset the whole block then add back later-->
<action method="unsetChild">
    <name>customer_account_navigation</name>
</action>
<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>
    <action method="addLink" translate="label" module="customer">
        <name>account_edit</name>
        <path>customer/account/edit/</path>
        <label>Account Information</label>
    </action>
    <action method="addLink" translate="label" module="customer">
        <name>address_book</name>
        <path>customer/address/</path>
        <label>Address Book</label>
    </action>
    <action method="addLink" translate="label" module="sales">
        <name>orders</name>
        <path>sales/order/history/</path>
        <label>My Orders</label>
    </action>
    <action method="addLink" translate="label" module="wishlist" ifconfig="wishlist/general/active">
        <name>wishlist</name>
        <path>wishlist/</path>
        <label>My Favorite</label>
    </action>
    <action method="addLink" translate="label" module="newsletter">
        <name>newsletter</name>
        <path>newsletter/manage/</path>
        <label>Newsletter Subscriptions</label>
    </action>
</block>

The you re-add the customer account navigation block & then add the required links.

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.