0
votes

I'm trying to get the product reviews and form showing on the product view page (view.phtml) I've looked at some forum posts and tried:

Finding in catalog.xml

<catalog_product_view translate="label">

And looking for the content:

<reference name="content"> 

In here I have entered the code:

<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>

In view.phtml I have added

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

I get an empty are where this is suppose to show the review information. I have tabs working what I want to do it just show the review form and reviews in that tab.

Any help is greatly appreciated.

2
Did you clear your xml cache after editing the layout file?Peter O'Callaghan
Hi, yes I've cleared all my cache after I made changes.2133215543

2 Answers

3
votes

I'm not sure why it is but I had the same problem. It worked for me when I referenced the review form and reviews inside the product view part of the catalog.xml like this.

    <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" />

I called them from view.phtml like this

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

Hope it helps

1
votes

Edit 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;?>