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

时间:2016-11-12 14:27:02

标签: php xml magento zend-framework magento-1.9

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

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

如何移动此块?

3 个答案:

答案 0 :(得分:1)

将块移动到产品页面, 你必须把代码放在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>

答案 1 :(得分:0)

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

答案 2 :(得分:0)

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

  

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

     

通过使用:<remove name="" />

     

通过使用:<action method="unsetChild">

也:按照其他人的建议更改Magento核心文件是坏习惯。您应该使用local.xml文件或自己的​​模块XML。我强烈建议您进一步研究Magento。