Skip to navigation Skip to content
Matthias Kerstner

Agile enthusiast, product-minded & user centric

  • Home
  • Blog
  • Contact
  • Home
  • Blog
  • Contact
Posted on 15/08/201420/08/2016 by Matthias Kerstner — 1 Comment

Remove customer account navigation links in Magento

Magento Logo

Sometimes you may want to remove certain navigation items in Magento’s built-in customer account navigation pane, such as “Recurring Profiles” or “My Applications” (OAuth). Fortunately, due to Magento’s underlying software architecture this can be achieved rather easily by disabling/removing the respective layout blocks.

Since the primary goal should be to create a solution that can be re-used for other systems and Magento versions the best option here is to write a simple Magento module that in addition can be controlled with your system’s local.xml. Thus, in order to be able to configure these navigation items in the customer account we need a module that adds functionality to actually removeLinkByName in local.xml, by redirecting requests to the original controller (Mage_Customer_Block_Account_Navigation) to a custom controller (KerstnerAt_FilterCustomerAccountNavigation_Block_Account_Navigation) which in turn unsets the corresponding layout blocks.

The Magento Module

First we need to setup the module: app/etc/modules/KerstnerAt_FilterCustomerAccountNavigation.xml:

<config>
  <modules>
    <KerstnerAt_FilterCustomerAccountNavigation>
      <version>1.0.0</version>
      <active>true</active>
      <codePool>local</codePool>
    </KerstnerAt_FilterCustomerAccountNavigation>
  </modules>
</config>

Followed by the module’s config.xml: app/local/KerstnerAt/FilterCustomerAccountNavigation/etc/config.xml:

<config>
  <global>
    <blocks>
      <customer>
        <rewrite> 
          <account_navigation>KerstnerAt_FilterCustomerAccountNavigation_Block_Account_Navigation</account_navigation>
        </rewrite>
      </customer>
    </blocks>
  </global>
</config>

Finally, our custom controller that actually removes the navigation items in the customer account by “un-setting” the corresponding layout blocks specified in local.xml: app/local/KerstnerAt/FilterCustomerAccountNavigation/Block/Account/Navigation.php:

class KerstnerAt_FilterCustomerAccountNavigation_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation {
  public function removeLinkByName($name) {
    unset($this->_links[$name]);
  }
}

Using local.xml to remove navigation items

As always, use local.xml to set configuration options for this custom module by specifying the blocks name. Here, we remove the “My Applications” and “Recurring Profiles” items:

<customer_account translate="label">
  ...
  <reference name="customer_account_navigation">
    <action method="removeLinkByName">
      <name>OAuth Customer Tokens</name>
    </action>
    <action method="removeLinkByName">
      <name>recurring_profiles</name>
    </action>
  </reference>
...

List of customer account navigation items in Magento

Here’s a full list of currently supported customer account navigation links:

  • My Account: account
  • Account Edit: account_edit
  • Address Book: address_book
  • My Orders: orders
  • My Tags: tags
  • My Wishlist: wishlist
  • My Applications: OAuth Customer Tokens
  • Recurring Profiles: recurring_profiles
  • Billing Agreements: billing_agreements
  • My Downloadable Products: downloadable_products
  • My Reviews: reviews
  • My Invitations: invitations
  • Newsletter Subscriptions: newsletter
  • Logout: logout

Additional (enterprise) links in customer account:

  • Customer Account Balance: enterprise_customerbalance
  • Giftcard Account: enterprise_giftcardaccount
  • Gift Registry: giftregistry
  • Reward Points: enterprise_reward

This module was tested with Magento 1.8 and higher. I will submit this module on Magento Connect too.

Categories: E-Commerce, Frameworks, Magento
Tags: customer account, customize, layout block, links, local.xml, Mage_Customer_Block_Account_Navigation, magento, magento module, remove navigation items, removeLinkByName

Post navigation

Previous post: Enabling Cross-Origin Resource Sharing CORS for Apache
Next post: Display localized dates in Magento

1 thought on “Remove customer account navigation links in Magento”

  1. Michael
    27/07/2016

    Working perfectly! Thank you so much for this!

    Reply
Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Imprint
  • Disclaimer and Privacy Policy

© 2023 Matthias Kerstner

© Matthias Kerstner 2023
Disclaimer and Privacy PolicyBuilt with Storefront.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Cookie settingsACCEPT
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
SAVE & ACCEPT