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.
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:
and then has its template file here:
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.
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:roduct/view/details.phtml" after="product.info.media">
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="Magento_Catalog:roduct/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:roduct/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
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,
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
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>
This is not working
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>