I am a beginner in Magento. I want to add a Review Tab in product view page. Can anyone help me how to do this?
I tried following approach:
<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml">
<!--action method="addTab" translate="title" module="catalog"><alias>additional</alias><title>General Info</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action-->
<action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>
<action method="addTab" translate="title" module="catalog"><alias>upsell</alias><title>Upsell</title><block>catalog/product_list_upsell</block><template>catalog/product/list/upsell.phtml</template></action>
<action method="addTab" translate="title" module="catalog"><alias>review</alias><title>Review</title><block>review/product_view_list</block><template>review/product/view/list.phtml</template></action>
<action method="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>
</block>
Then using echo $this->getChildHtml('info_tabs');
in view.phtml.
Only description, review and additional information are visible. What may be the problem? Thanks
Here is my answer from this duplicate question
This is how I handled this situation in one of my projcets:
Add tab with reviews,
Now, the review form is handled by the different type of block which normally is a sub-block of review page. There is no way to make nested block with
addTab
action but you can use<reference>
handler after creating review block in tabs like this:name
in<reference>
handler must be equal to what is in<alias>
inaddTab
action.And in
catalog/product/view/tabs/reviews.phtml
you just use,You can use
<reference>
handler to add more block to review list and review form.Of course, you have to create files for review list and review form in the paths entered in
template
argument, so in this case you would need to createcatalog/product/view/tabs/reviews.phtml
andcatalog/product/view/tabs/review_form.phtml
. You can change review form template to the default onereview/form.phtml
If you do not need change the code there or you will be using it only in that tab but review list might need more changes in html structure so it is good idea to create separate file for it and use parts of the default code as needed.