Avec Magento 1.9, il y a beaucoup de fonctionnalités dans Mon compte notamment dans la navigation latérale. Et souvent, tu n’en utilises pas la moitié. Voici une solution simple pour supprimer ces liens :
Dans le fichier 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>
Dans le fichier 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]);
}
}
Dans le fichier 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>
Et pour finir dans ton fichier local.xml :
<customer_account>
<reference name="customer_account_navigation">
<action method="removeLinkByName"><name>recurring_profiles</name></action>
<action method="removeLinkByName"><name>billing_agreements</name></action>
</reference>
</customer_account>
Source : http://stackoverflow.com/questions/5887664/remove-navigation-links-from-my-account
Ajouter votre avis