2013-08-30 64 views
2

后,我想改变顶部链接 在默认设置的Magento显示我的账户只显示登录

我的帐号|我的收藏| |我的购物车|结帐|登录

我需要改变顶部链接,只有当用户在你的主题是登录

THX的帮助

回答

6

在customer.xml后显示我的帐户链接它看起来像

<default> 
     <!-- Mage_Customer --> 
     <reference name="top.links"> 
      <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action> 
     </reference> 
    </default> 
<customer_logged_in> 
    <reference name="top.links"> 
     <action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action> 
    </reference> 
</customer_logged_in> 

default标签删除我的帐户链接到Customer_logged_in

更改后更改它在customer.xml

<default> 
     <!-- Mage_Customer --> 
     <reference name="top.links"> 

     </reference> 
    </default> 

<!-- 
Load this update on every page when customer is logged in 
--> 

<customer_logged_in> 
    <reference name="top.links"> 
    <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action> 
     <action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action> 
    </reference> 
</customer_logged_in> 

希望这将肯定帮你。

+0

这是解决我的问题,THX – user1958112

+0

精彩的如此简单和直接。这可以使用local.xml实现吗?有时我觉得懒惰的主题文件;-) – echoashu

0
<customer_logged_in> 
<reference name="top.links"> 
    <action method="addLink" translate="label title"> 
     <label>Your Account</label> 
     <url helper="customer/getAccountUrl" /> 
     <prepare/> 
     <urlParams/> 
     <liParams> 
      <id>header-account-link</id> 
     </liParams> 
     <aParams/> 
     <beforeText/> 
     <afterText/>     
    </action> 
</reference> 

+0

请解释你的答案与随附的代码。 – kingdamian42