I want to remove My Tags link from sidebar in my account page without changing in base files.
How can I do it?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI want to remove My Tags link from sidebar in my account page without changing in base files.
How can I do it?
Create a small module to do it:
Step 1) Create file Prasan_Customerlinks.xml at app\etc\modules:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Prasan_Customerlinks>
<active>true</active>
<codePool>local</codePool>
</Prasan_Customerlinks>
</modules>
</config>
Step 2) Create Navigation.php at app\code\local\Prasan\Customerlinks\Block\Account\
<?php
class Prasan_Customerlinks_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation {
public function removeLinkByName($name){
unset($this->_links[$name]);
return $this;
}
}
Step 3) Create file config.xml at app\code\local\Prasan\Customerlinks\etc\
<?xml version="1.0" encoding="UTF-8"?>
<config>
<global>
<blocks>
<customer>
<rewrite>
<account_navigation>Prasan_Customerlinks_Block_Account_Navigation</account_navigation>
</rewrite>
</customer>
</blocks>
</global>
</config>
Step 4) Then in your local.xml file add following code.if local.xml file is not present create at app/design/frontend/yourpackage/yourtheme/layout/
<customer_account>
<reference name="customer_account_navigation">
<action method="removeLinkByName"><name>tags</name></action>
</reference>
</customer_account>
P.S. For more information you can check my post on my blog http://pradeepsanku.com/2015/06/17/remove-customer-account-navigation-links-using-layout-xml-magento/