共计 1972 个字符,预计需要花费 5 分钟才能阅读完成。
首先先找到
<blocktype="catalog/product_view_tabs"name="product.info.tabs"as="info_tabs"template="catalog/product/view/tabs.phtml"> <actionmethod="addTab"translate="title"module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action> <actionmethod="addTab"translate="title"module="catalog"><alias>additional</alias><title>Additional Information</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action> <blocktype="review/form"name="product.review.form"as="review_form"> <blocktype="page/html_wrapper"name="product.review.form.fields.before"as="form_fields_before"> <actionmethod="setMayBeInvisible"><value>1</value></action> </block> </block></block>
替换为
<blocktype="catalog/product_view_tabs"name="product.info.tabs"as="info_tabs"template="catalog/product/view/tabs.phtml"><actionmethod="addTab"translate="title"module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action><actionmethod="addTab"translate="title"module="catalog"><alias>additional</alias><title>Additional Information</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action><blocktype="review/product_view_list"name="product.info.product_additional_data"as="product_review"template="review/product/view/list.phtml"> <blocktype="review/form"name="product.review.form"as="review_form"> <blocktype="page/html_wrapper"name="product.review.form.fields.before"as="form_fields_before"> <actionmethod="setMayBeInvisible"><value>1</value></action> </block> </block></block>
然后在模板对应位置加入
<?phpecho$this->getChildHtml('product_review') ?>
这里有个要注意的地方就是,xml文件中添加模块,必须在你添加的模块里面的父级模块中添加,否则可能出现无法调用模块的问题