magento menu

The best way to delete unlike links is to write easy module. At the beginning please create configurative file which will be the part of our module ((app/code/local/Global4net/Customerlinks/config.xml) and rewrite the following code :

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?xml version="1.0" encoding="UTF-8"?>
 
<config>
 
    <global>
 
        <blocks>
 
            <customer>
 
                <rewrite>
 
                    <account_navigation>Global4net_Customerlinks_Block_Account_Navigation</account_navigation>
 
                </rewrite>
 
            </customer>
 
        </blocks>
 
    </global>
 
</config><br><br>

 

Next we can overwrite the navigation block. As to do this please create the file located in app/code/local/Global4net/Customerlinks/Block/Account/Navigation.php and put the following code:

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
 
  
 
class Global4net_Customerlinks_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation {
 
  
 
    public function removeLinkByName($name) {
 
        unset($this->_links[$name]);
 
    }
 
  
 
}
 
  
 
?>

 

  

Above code created new method removeLinkByName which will allow us to delete linkds in proper xml file. Now, we need to activate our module so as to this create the file app/code/etc/modules/Global4net_Customerlinks.xml

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?xml version="1.0" encoding="UTF-8"?>
 
<config>
 
    <modules>
 
        <Global4net_Customerlinks>
 
            <active>true</active>
 
            <codePool>local</codePool>
 
        </Global4net_Customerlinks>
 
    </modules>
 
</config>

 


Now we are able to move to the xml file- the best is to go to Your own file locale.xml where we will locate all changes (app/design/frontend/default/nazwa_szablonu/layout/loccal.xml)
 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?xml version="1.0"?>
 
<layout version="0.1.0"
 
    <customer_account>
 
        <reference name="customer_account_navigation">
 
            <action method="removeLinkByName">
 
                <name>recurring_profiles</name>
 
            </action>
 
            <action method="removeLinkByName">
 
                <name>billing_agreements</name>
 
            </action>
 
            <action method="removeLinkByName">
 
                <name>OAuth Customer Tokens</name>
 
            </action>
 
            <action method="removeLinkByName">
 
                <name>downloadable_products</name>
 
            </action>
 
        </reference>
 
    </customer_account>
 
</layout>

 

  

 

The above code will allow us to remove Recurring profiles, Billing agreements, My applications and Donloadable products from the Client’s panel.