繁体   English   中英

Magento-view.phtml上未显示产品评论

[英]Magento - product reviews not showing on view.phtml

我正在尝试在产品查看页面(view.phtml)上显示产品评论和表单,我查看了一些论坛帖子并尝试过:

在catalog.xml中查找

<catalog_product_view translate="label">

并寻找内容:

<reference name="content"> 

在这里,我输入了代码:

<block type="review/product_view_list" name="product.info.product_additional_data" as="reviews" template="review/product/view/list.phtml"/>

<block type="review/product_view_list" name="product.info.product_additional_data" as="product_additional_data" template="review/product/view/list.phtml">
                <block type="review/form" name="product.review.form" as="review_form">
                    <block type="page/html_wrapper" name="product.review.form.fields.before" as="form_fields_before" translate="label">
                        <label>Review Form Fields Before</label>
                        <action method="setMayBeInvisible"><value>1</value></action>
                    </block>
                </block>
 </block>

在view.phtml中,我已添加

<?php echo $this->getChildHtml('product_additional_data') ?>
<?php echo $this->getChildHtml('reviews') ?>

我得到的是一个空白,应该在此处显示评论信息。 我有一些选项卡可以满足我的需求,只需在该选项卡中显示评论表单和评论即可。

任何帮助是极大的赞赏。

我不确定为什么会这样,但是我遇到了同样的问题。 当我引用审阅表单并像这样在catalog.xml的产品视图部分中进行审阅时,它为我工作。

    <block type="review/product_view_list" name="review.product_view_list" as="product_view_list" template="review/product/view/list.phtml"/>
   <block type="review/form" name="product.review.form" as="review_form" />

我从view.phtml这样称呼他们

    <?php echo $this->getChildHtml('review_form') ?>
    <?php echo $this->getChildHtml('product_view_list') ?>

希望能帮助到你

编辑local.xml

<catalog_product_view>
    <reference name="content">
        <block type="review/product_view_list" name="review.product_view_list" as="product_view_list" template="review/product/view/list.phtml"/>
        <block type="review/form" name="product.review.form" as="review_form" />
    </reference>
</catalog_product_view>

view.phtml

<?php foreach ($this->getChildGroup('detailed_info', 'getChildHtml') as $alias => $html):?>
    <div class="box-collateral <?php echo "box-{$alias}"?>">
        <?php if ($title = $this->getChildData($alias, 'title')):?>
            <h2><?php echo $this->escapeHtml($title); ?></h2>
        <?php endif;?>
        <?php echo $html; ?>
    </div>
<?php endforeach;?>

暂无
暂无

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

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