如何删除“我的购物车”和“结帐”; Magento 中的菜单链接?
我正在使用 Magento 1.4,我想从顶部导航菜单中删除“结帐”和“我的购物车”链接。我知道我必须更改布局文件中的某些内容,但我不确定是哪一个。我搜索了“checkout”和“addLink”,但没有找到与这两个链接相关的内容。
I'm using Magento 1.4 and I want to remove the "Checkout" and "My Cart" links from the top navigation menu. I know I have to change something in a layout file but I'm not sure which one. I searched for "checkout" and "addLink" but found nothing related to those two links.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最好的方法是不要触及核心布局文件,而是最好的选择是仅使用一个布局文件 local.xml 创建自定义主题,如所述此处 要从顶部菜单中删除链接,您需要在 local.xml 文件中添加这些行:
我相信这会删除顶部菜单中的结账和我的购物车链接。如果这不起作用,请尝试将 top.links 更改为 topLinks,因为在 page.xml 中它被声明为“topLinks”
The best way is to not touch the core layout files, instead your best bet is to create custom theme with only one layout file local.xml like described here To remove the links from the top menu you would need to add these lines in your local.xml file:
I believe this will remove the checkout and my cart links from the top menu. If this doesn't work, try changing top.links with topLinks since in page.xml it is declared as="topLinks"
要在自定义包/主题中更改此设置,请从
$MAGENTO/app/design/frontend/base/default/layout/checkout.xml
复制布局文件checkout.xml
到$MAGENTO/app/design/$PACKAGE/$THEME/layout/checkout.xml
然后找到以下行:
在该文件中。
然后只需注释掉这些行(将
放在每行的末尾)。
就 CSS 选择器而言,这将是:
layout >默认>参考[name='top.links']>块>行动
To change this in a custom package/theme, copy the layout file
checkout.xml
from$MAGENTO/app/design/frontend/base/default/layout/checkout.xml
to$MAGENTO/app/design/$PACKAGE/$THEME/layout/checkout.xml
Then find the following lines:
<action method="addCartLink"></action>
<action method="addCheckoutLink"></action>
in that file.
Then just comment those lines out (put
<!--
at the beginning of each line and put-->
at the end of each line).In terms of CSS selectors, this would be:
layout > default > referance[name='top.links'] > block > action
为了同时结帐链接和顶级购物车,您需要将它们放在
中。布局文件夹中 local.xml 的
(app/design/frontend/THEME/THEMENAME/layout/
)In order to do BOTH the Checkout link and the Top Cart you'll need to put these within the
<default> </default>
of your local.xml in your layout folder (app/design/frontend/THEME/THEMENAME/layout/
)