繁体   English   中英

magento 1.9 - 将块移动到产品页面

[英]magento 1.9 - move block into a product page

我想在产品页面的简短描述下包含“wrapper.phtml”的移动块。

我必须使用view.phtml或catalog.xml?

我怎么能移动这个街区?

要将块移动到产品页面,您必须将代码放在catalog.xml中。

<block type="catalog/product_view" name="product.info.options.wrapper" as="product_options_wrapper" template="catalog/product/view/options/wrapper.phtml" translate="label">

例如:

<catalog_product_view translate="label">
  <reference name="content">
    <block type="core/template" name="product.info.options.wrapper" as="product_options_wrapper" template="{your_file_path}/wrapper.phtml" translate="label">
  </reference>
</catalog_product_view>

您可以使用catalog.xml更改块。 你可以在catalog.xml中找到名为“product.info.options.wrapper”的块

我知道这是一个老问题。 但是,为了便于获取信息,请参阅http://magebase.com/magento-tutorials/5-useful-tricks-for-your-magento-local-xml/以获取“删除,重新排列和替换模板”中的答案阻止“部分。 如上所述:

有两种方法可以删除布局XML中的块:

使用: <remove name="" />

使用: <action method="unsetChild">

另外:它是不好做法 ,改变Magento的核心文件被别人的建议。 您应该使用local.xml文件或您自己的模块XML。 我强烈建议更多地学习Magento。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM