是magento的新手
是否有人知道在客户帐户信息中心导航中删除My Orders
链接的位置?
答案 0 :(得分:2)
得到了Guyz
这非常棘手而且很难
只想评论下面的代码
sales.xml 中的
<customer_account>
<!-- Mage_Sales -->
<reference name="customer_account_navigation">
<action method="addLink" translate="label" module="sales"><name>orders</name><path>sales/order/history/</path><label>My Orders</label></action>
</reference>
</customer_account>
答案 1 :(得分:1)
我认为这是一个混凝土链接,但是如果你想删除任何指向客户仪表板的链接,你可以制作一个小模块来向块添加新动作Mage_Customer_Block_Account_Navigation to
这里的解决方案:
您的扩展程序中的自定义阻止程序:
class CA_Removecustomerlinks_Block_Account_Navigation extends Mage_Customer_Block_Account_Navigation
{
/**
* Removes link by name
*
* @param string $name
* @return Mage_Page_Block_Template_Links
* @author @davidselo
* @company @compraAmiga
*/
public function removeLinkByName($name)
{
foreach ($this->_links as $k => $v) {
if ($v->getName() == $name) {
unset($this->_links[$k]);
}
}
return $this;
}
}
模块的配置
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<CA_Removecustomerlinks>
<version>0.1.0</version>
</CA_Removecustomerlinks>
</modules>
<global>
<blocks>
<customer>
<rewrite>
<account_navigation>CA_Removecustomerlinks_Block_Account_Navigation</account_navigation>
</rewrite>
</customer>
</blocks>
</global>
</config>
现在您可以在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>
<action method="removeLinkByName"><name>downloadable_products</name></action>
</reference>
</customer_account>