cancel
Showing results for 
Search instead for 
Did you mean: 

Review tab is not showing in magento2 product page.

Review tab is not showing in magento2 product page.

Hi,

 

I have created custom theme but review tab is not showing on product page if I change my custom theme with default luma theme than review tab start displaying on product page .

 

Is there someone how can guide me what am I doing wrong.

 

Thanks in advance for your help.

8 REPLIES 8

Re: Review tab is not showing in magento2 product page.

Is it a custom theme that you've created from scratch or did you start with a third party one?

 

The default review is defined in the layout here: 

 

https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Catalog/view/frontend/layout/c...

 

and then has its template file here: 

 

https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Catalog/view/frontend/template...

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Review tab is not showing in magento2 product page.

Hi,

 

Yes I have created custom theme from scratch. Can you please let me know what can I do to make it work in my custom theme.

Re: Review tab is not showing in magento2 product page.


Hi rahul68

You have to call tabbing in your xml file.

1) obverride the below xml in your theme.
Catalog/view/frontend/layout/catalog_product_view.xml

2) Copy the below content under the "<referenceContainer name="content">" at the last.

<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="Magento_Catalog:Smiley Tongueroduct/view/details.phtml" after="product.info.media">
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="Magento_Catalog:Smiley Tongueroduct/view/attribute.phtml" group="detailed_info">
<arguments>
<argument name="at_call" xsi:type="string">getDescription</argument>
<argument name="at_code" xsi:type="string">description</argument>
<argument name="css_class" xsi:type="string">description</argument>
<argument name="at_label" xsi:type="string">none</argument>
<argument name="title" translate="true" xsi:type="string">Details</argument>
</arguments>
</block>
<block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes" as="additional" template="Magento_Catalog:Smiley Tongueroduct/view/attributes.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">More Information</argument>
</arguments>
</block>
</block>
<block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
<arguments>
<argument name="triggers" xsi:type="array">
<item name="compareProductLink" xsi:type="string">.action.tocompare</item>
</argument>
</arguments>
</block>

3) I hope you will see tabbing in your theme.

 
If Issue Solved, Click Kudos/Accept As solutions.

Thanks

Re: Review tab is not showing in magento2 product page.

Hi,

 

Thanks for your reply,

 

I have already override catalog_product_view.xml file in my custom theme magento_catalog layout folder.

 

And this code is already there in that file as this code only display detail's and more information tabs.

 

Can you please let me know which code I place for display review tab.

 

Thanks,

Re: Review tab is not showing in magento2 product page.

Hi 


There are some possibilities. 
1) Is yourcatalog_product_view.xml file is properly override?

2) File Magento_Catalog: product/view/details.phtml is responsible for show the tabbing on product detail page.

3) Check your Tabbing is hide or display:none in CSS?

 

Thanks

 

Re: Review tab is not showing in magento2 product page.

Hello,

 

Review block will not work in custom Magento 2 theme.

 

To show Review tab on the product page you should have to JsLayout at the following location.

app/design/frontend/{Vendor}/{theme}/Magento_Review/layout/catalog_product_view.xml

 

Add the following code in above located file.

 

<referenceBlock name="product.review.form">
 <arguments>
    <argument name="jsLayout" xsi:type="array">
        <item name="components" xsi:type="array">
            <item name="review-form" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Review/js/view/review</item>
            </item>
        </item>
    </argument>
</arguments>
</referenceBlock>

Re: Review tab is not showing in magento2 product page.

This is not working

Re: Review tab is not showing in magento2 product page.

 

add below code in app/design/frontend/{Vendor}/{theme}/Magento_Review/layout/catalog_product_view.xml

<referenceBlock name="product.review.form">
 <arguments>
    <argument name="jsLayout" xsi:type="array">
        <item name="components" xsi:type="array">
            <item name="review-form" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Review/js/view/review</item>
            </item>
        </item>
    </argument>
</arguments>
</referenceBlock>