我正在尝试使用local.xml文件重新排列顶部链接的顺序,到目前为止一切进展顺利,但是对于购物车我一直得到一个不存在的URL。
首先,我只是按照以下方式将块添加回顶部链接
<reference name="top.links.custom">
<action method="addLink" translate="label title" module="customer"><label>Account</label><url helper="customer/getAccountUrl"/><title>Account</title><prepare/><urlParams/><position>130</position></action>
<action method="addLink" translate="label title" module="customer"><label>Home</label><url helper="core/url/getHomeUrl"/><title>Home</title><prepare/><urlParams/><position>50</position></action>
<block type="checkout/links" name="check_cart_link_custom">
<action method="addCartLink"></action>
</block>
通过添加到我的购物车中起作用。那么我想把它定位为最后一个链接,所以我想我可以使用以下代码片段
<reference name="top.links.custom">
<action method="addLink" translate="label title" module="customer"><label>Account</label><url helper="customer/getAccountUrl"/><title>Account</title><prepare/><urlParams/><position>130</position></action>
<action method="addLink" translate="label title" module="customer"><label>Home</label><url helper="core/url/getHomeUrl"/><title>Home</title><prepare/><urlParams/><position>50</position></action>
<action method="addLink" translate="label title" module="checkout"><label>Cart</label><url helper="checkout/cart/"/><title>Cart</title><prepare/><urlParams/><position>150</position></action>
</reference>
这个或者使用“addCartLink”都不起作用。那么在toplinks中为我的购物车使用addLink的正确方法是什么?
答案 0 :(得分:4)
尝试以下代码:
<action method="addLink" translate="label title" module="checkout">
<label>Cart</label>
<url helper="checkout/url/getCartUrl"/>
<title>Cart</title>
<prepare/>
<urlParams/>
<position>150</position>
</action>