How to remove redundant Links in Magento backup using Layout XML

0

When working with Magento, you may find some unnecessary links that should be removed from your Magento backend. In this tutorial for beginner, we’re going to learn how to remove customer account links in the menu, you can also do the same to other menu links.

remove customer navigation link
There’re some navigation links that can be removed by turning off their features, however, there are many links need to be removed from Magento Core Layout XML file.

In this tutorial, we will learn how to remove the Recurring Profiles link in My Account drop-down menu.

This link is added by XML layout declaration in app/design/frontend/base/default/layout/sales/recurring_profile.xml:

 

1. CREATE OUR CUSTOM MODULE

First things first, we need to create and declare and module.

Create app/etc/modules/Acme_Module.xml. This will tell Magento about the Module that contains our rewritten class.

2. CREATE APP/CODE/LOCAL/ACME/MODULE/ETC/CONFIG.XML

Next, we will tell Magento where to find the module. Now, create app/code/local/Acme/Module/etc/config.xml and insert the following code:

 

3. INSTALL APP/CODE/LOCAL/ACME/MODULE/BLOCK/ACCOUNT/NAVIGATION.PHP

Now, install this in app/code/local/Acme/Module/Block/Account/Navigation.php:

4. REMOVE LINK WITH LOCAL.XML

After you’re done the 3 steps above, just add this to our local.xml to remove link

The name argument can be determined by finding the name as described in the original XML files where addLink  was called.

If you have any questions or feedback, feel free to drop a comment.

Happy coding!

Rate this post

Share.

About Author

Daniel is a Magento developer with 5 years of experience with customizing Magento extensions, Magento templates. He's main author at Magento explorer

Leave A Reply