2

On the default Magento installation, when a customer registers they are brought to the customer dashboard, which displays several entries in the customer dashboard screen menu under the MY ACCOUNT heading. In this menu there is an entry for "My Downloadable Products". Since I am setting up a store which only offers Simple Products, I would like to delete this entry from the customer dashboard. Is there a way to remove it from the admin interface without having to modify source code?

Thanks.

1

2 Answers 2

2

Removing the link can be done by commenting it out in the downloadable.xml layout file. Copy the file to your template layout directory and edit around line 30 like this:

[...]
<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>
[...]

Now if you're not planning on using the downloadable products at all I'd like to suggest turning off this module all together by editing app/etc/modules/Mage_Downloadable.xml changing <active>true</active> to <active>false</active>.

3

Rather than copying downloadable.xml to your theme and editing it directly, use the removeLinkByName plugin in local.xml* with the following solution from Daniel Sloof (@danslo):

I had a similar problem, and I didn't want to comment out addLink node because we want to implement our changes in local.xml only. Ended up writing a small module to do it:

app\etc\modules\Stackoverflow_Customerlinks.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Stackoverflow_Customerlinks>
            <active>true</active>
            <codePool>local</codePool>
        </Stackoverflow_Customerlinks>
    </modules>
</config>

app\code\local\Stackoverflow\Customerlinks\Block\Account\Navigation.php:

<?php

class Stackoverflow_Customerlinks_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation {

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

}

?>

app\code\local\Stackoverflow\Customerlinks\etc\config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <global>
        <blocks>
            <customer>
                <rewrite>
                    <account_navigation>Stackoverflow_Customerlinks_Block_Account_Navigation</account_navigation>
                </rewrite>
            </customer>
        </blocks>
    </global>
</config>

After that, you can simply make the changes through local.xml:

<customer_account>
    <reference name="customer_account_navigation">
        <action method="removeLinkByName"><name>downloadable_products</name></action>
    </reference>
</customer_account>

*If the local.xml file does not exist in your theme's layout directly, you'll have to create it.

Source: https://stackoverflow.com/questions/5887664/remove-navigation-links-from-my-account

1
  • I had removeLinkByName working just fine for months and now it causes a fatal error/error report.
    – iphigenie
    Jun 30, 2017 at 16:11

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.