0

We are displaying tabs in product view page as below

enter image description here

Under Add Review tab we need to provide an option to write review for customer.

we are following this link , what i did is i added below code in catalog.xml file

<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>tab_review_list</alias><title>Product Reviews</title><block>review/product_view_list</block><template>catalog/product/view/tabs/reviews.phtml</template></action>
</block>

<reference name="tab_review_list">
  <block type="review/form" name="tab_review_form" as="review_form" template="catalog/product/view/tabs/review_form.phtml" />
</reference>

and using <?php echo $this->getChildHtml('review_form'); ? > in view.phtml file

2

3 Answers 3

2

In catalog.xml ,

In <catalog_product_view translate="label"> handler

add below

<reference name="review_tabbed">
   <block type="review/form" name="tab_review_form" as="review_form" template="review/form.phtml" />
</reference>

In

 <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
        ......
        ......
     </block>

Add below

<action method="addTab" translate="title" module="review" ><alias>review_tabbed</alias><title>Reviews</title><block>review/product_view_list</block><template>review/product/view/list.phtml</template></action>
3
  • i can not able to find this line : <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" > Jul 5, 2016 at 13:05
  • can you please tell me where i need to second block of code in catalog.xml file Jul 5, 2016 at 13:12
  • <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" > will be in layout/catalog.xml of theme
    – Ajay
    Jul 5, 2016 at 14:32
1

It will be something like below. Or you can create local.xml and put below code into this.

<?xml version="1.0" encoding="UTF-8"?>
<layout> 
<catalog_product_view translate="label">
         <reference name="product.info.additional">       
          <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs">
            <action method="setTemplate" ><template>catalog/product/view/tabs.phtml</template></action>
            <action method="addTab" translate="title" module="catalog" ><alias>description_tabbed</alias><title>Product Features</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>
            <action method="addTab" translate="title" module="catalog" ><alias>additional_tabbed</alias><title>Additional Info</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action>               

            <action method="addTab" translate="title" module="review" ><alias>review_tabbed</alias><title>Reviews</title><block>review/product_view_list</block><template>review/product/view/list.phtml</template></action>
          </block>
         </reference>        
        <reference name="review_tabbed">
            <block type="review/form" name="tab_review_form" as="review_form" template="review/form.phtml" />
        </reference>             
</catalog_product_view>
</layout>
1
  • i added code in local.xml but it didt added any review tab here is i need to add any code in view.phtml file? is review tab in view page is 1.9 default feature ? Jul 5, 2016 at 18:07
1

I had issues getting the review option to show up on our site also.
It turns out that the value for this query was 1;
select * from magento.core_config_data where path ='advanced/modules_disable_output/Magento_Review'.

Once I flipped the value to 0 and flushed the cache, the review tab showed up for our products.

1
  • in backend we have Mage_Review module enabled under system>configuration>Advanced>Advanced. is i need to disable it ? Jul 6, 2016 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.