Magento通过本地xml向产品附属品添加一个部分无法正常工作

shn*_*lla 2 magento magento-layout-xml

我已按照本文将产品评论添加到产品页面的附属部分:http: //www.crearegroup-ecommerce.co.uk/blog/magento-tutorials/product-reviews-on-product-view-page .PHP

我已将以下代码添加到我的local.xml:

<catalog_product_view translate="label">
    <reference name="content">
       <block type="review/product_view_list" name="product.info.product_additional_data" as="product_review" template="review/product/view/list.phtml">
          <block type="review/form" name="product.review.form" as="review_form"/>
       </block>
    </reference>
Run Code Online (Sandbox Code Playgroud)

以及view.phtml中的以下代码:

<?php echo $this->getChildHtml('product_review') ?>
Run Code Online (Sandbox Code Playgroud)

以上是在getChildHtml的其他一些调用之间添加的(在附属部分)

问题:评论和表单是否已添加到页面末尾而非附加部分?

任何帮助表示赞赏.谢谢.

Jos*_*ter 5

将引用名称更改contentproduct.info.当您将其添加到内容节点(这是一个core/text_list块)时,它会自动将其附加到底部.这就是为什么你需要将它放在product.info节点内,然后在模板中引用它.