magento 中的自定义块
我在 checkout.xml 中添加了此块:
<block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/>
然后,我在 cart.phtml 中显示了此内容:
echo $this->getChildHtml('shipping');
然后,我在购物车文件夹中创建了一个页面作为 Shipping.phtml 文件。这在我的本地电脑上运行,但是当我在服务器上遵循此路径时,没有显示任何块。这两种环境之间有一个区别:在本地,我在基本文件夹中执行所有这一步,但在服务器上,默认文件夹中有一个自定义主题文件夹。
谁能告诉我哪里错了?
提前致谢。
I have added this block in checkout.xml:
<block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/>
Then, I have shown this in cart.phtml:
echo $this->getChildHtml('shipping');
Then, I have made a page as shipping.phtml file in cart folder. This is working on my local PC, but when I follow this path on the server no block is showing. There is one difference between the two environments: on local I am doing all this step in the base folder, but on the server there is a customized theme folder in the default folder.
Can anyone tell me where I am wrong?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查服务器上的设计配置,该主题是否确实加载。
Check design's configuration on server, is this theme really loaded.
确保您正确添加了 XML(没有任何拼写错误)。 XML 中的拼写错误可能会导致 Magento 加载默认的 checkout.xml 而不是自定义的,从而丢失块更改。
Make sure that you added the XML correctly (without any typos). A typo in the XML would probably cause Magento to load the default checkout.xml instead of your custom one, losing your block changes.