How to Add Review List And Review Form On Magento Product Page Tab


If you want to add customer reviews on product page tab these steps may help you.

Locate and open your theme’s catalog.xml file

- On the file look/search for: catalog_product_view
- Look for the content enclosed within
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
- Add your review form and list as shown below.
<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
  <block type="review/form" name="product.review.form" as="review_form"/>                                  
  <action method="addTab" translate="title" module="review">
    <alias>product_additional_data</alias>
    <title>Reviews</title>
    <block>review/product_view_list</block>
    <template>review/product/view/list.phtml</template>
  </action>                  
</block>
- Your final result should look something like this.
<reference name="content">
  ...
  <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
    <block type="review/form" name="product.review.form" as="review_form"/>                                  
    <action method="addTab" translate="title" module="review">
    <alias>product_additional_data</alias>
    <title>Reviews</title>
    <block>review/product_view_list</block>
    <template>review/product/view/list.phtml</template>
    </action>                  
  </block>    
  ...
</reference>
- Finally you will need to make these changes to the review list template file.
Look for and open file review/product/view/list.phtml
On this file and near the bottom of it, look for and comment out this line
#echo $this->getChildHtml('review_form')
Then, add this line underneath
$layout = Mage::getSingleton('core/layout');
echo $layout->getBlock('content')->getChild('product.info')->getChild('info_tabs')->getChild('review_form')->toHtml();

Source: http://www.magentodeveloperleedsuk.co.uk/add-review-list-and-review-form-on-product-page-tab/

0 comments:

Post a Comment