Magento checkout.xml 文件无法识别
我最近从头开始构建 Magento 主题,并遇到了 checkout.xml 文件的问题。系统似乎无法识别。我这么说的原因是我试图注释掉以下代码以从顶部菜单中删除“我的购物车”和“结账”链接。
<action method="addCartLink"></action>
<action method="addCheckoutLink"></action>
这应该会删除链接,但不会。我什至删除了文件中的所有代码并保存它,看看它是否会破坏系统或引发任何错误,但无济于事。我设法使用 customer.xml 文件中的以下代码删除链接,但仍然觉得我应该知道为什么有问题的文件没有被识别以加深对 Magento 的理解。
<remove name="checkout_cart_link"/>
我要补充的是,这些布局文件是在我最初安装主题后添加到布局文件夹中的,但这应该不是问题,因为在 customer.xml 文件中一切正常,但在 checkout.xml 中则不然。我还清除了后端的缓存。这不起作用。
任何想法将不胜感激。谢谢。
I've recently been building a Magento theme from scratch and have encountered a problem with the checkout.xml file. It doesn't seem to be recognised by the system. The reason I say this is that I was trying to comment out the following code to remove the My Cart and Checkout links from the top menu.
<action method="addCartLink"></action>
<action method="addCheckoutLink"></action>
This should remove the links but wouldn't. I even deleted all the code from the file and saved it to see if it would break the system or bring up any errors, to no avail. I managed to remove the links using the following code in the customer.xml file, but still feel I should know why the problematic file is not being recognised to develop an understanding of Magento.
<remove name="checkout_cart_link"/>
I will add that these layout files were added to the layout folder after I initially installed the theme, but this shouldn't be a problem as all worked fine in the customer.xml file, yet not the checkout.xml. I also cleared the cache in the backend. This did not work.
Any ideas would be seriously appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
了解布局系统的工作原理,然后使用提到的布局查看器 来调试布局。
我的前三个猜测
清除你的缓存(你做了,但布局查看器会让你知道 Magento 实际看到的内容)
您正在编辑错误的 checkout.xml(当您开始通过复制旧主题来添加多个主题时很容易做到)
还有另一个块正在添加这些链接
Read up on how the layout system works, and then use the mentioned Layout Viewer to debug your layout.
My first three guesses
Clear your cache (which you did, but layout viewer will let you know what Magento is actually seeing)
You're editing the wrong checkout.xml (easy to do when you start adding multiple themes by copying the old)
There's another block that's adding those links
我遇到了同样的问题,并在我们的主机上发现了问题,我在 checkout.xml 中进行了一些更改并丢失了结帐功能,我确信我所做的是正确的。
问题是文件权限问题。当我修改服务器上的任何文件时,其权限更改为 644,因此为了解决此问题,我将权限更改为 755,并且我的更新一切正常:)
I faced same problem and found problem on our host, I made some changes in checkout.xml and lost the checkout functionality, I was sure that what I did was correct.
Problem was file permission issue. when I modify any file on server its permission changed to 644 so to fix that I changed the permission to 755 and all is fine with my updates :)