Magento产品描述页增加一个客户评价(Customer Reviews)的tab标签。

产品描述页默认有产品详细情况及让客户增加产品标签这二个tabs,要做到淘宝那样显示客户评价,我找到以下方法增加一个客户评价tab:

 

1. 打开模版路径 layout 目录下的 review.xml 文件, 在页面最下的</layout>之上,添加如下代码:

<catalog_product_view> <reference name="product.info.tabs"> 
<block type="review/form" name="product.review.form" as="review_form" /> <action method="addTab" translate="title" module="review">
 <alias>reviews</alias>
 <title>Product's Review</title>
 <block>review/product_view_list</block>
 <template>review/product/view/mylist.phtml</template>
 </action>
</reference>
 </catalog_product_view>

 

2. 进入  template/review/product/view/ 文件夹,复制一份list.phtml,更名为mylist.phtml

 

3. 打开mylist.phtml 文件,在代码最下面,加上以下代码:

<?php
$layout = Mage::getSingleton('core/layout');
$block = $layout->getBlock('content')->getChild('product.info')->getChild('info_tabs')->getChild('review_form');
echo $block->toHtml();
?>

 

 

 

 

posted @ 2014-10-18 14:14  QQ9915072  阅读(278)  评论(0编辑  收藏  举报