7

I need to remove review tab in product page.Please suggest a solution catalog_product_view.xml in my custom module

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="reviews.tab" remove= "true"/>
        <referenceBlock name="product.info.review">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">XXX_YYYY::review.phtml</argument>
            </action>
            <block class="Magento\Framework\View\Element\Template" name="custom.review.popup" template="XXX_YYYY::popup.phtml">
                <block class="Magento\Review\Block\Form" name="custom.product.review.form" as="custom.review_form" template="XXX_YYYY::form.phtml"/>
            </block>
        </referenceBlock>
    </body>
</page>
  • Your magento version..? 2.2.0 ? – Rizwan Khan Dec 9 '17 at 9:03
  • My version is magento 2.2.0 – Jaisa Dec 9 '17 at 9:33
  • Hello Jayashree I could not understand your target. If you are about to removing block then your first action works well. What are you willing to do? – Purushotam Sangroula Dec 9 '17 at 17:44
9

Can try following XML, for remove Review Tab on Product page

<referenceBlock name="reviews.tab" remove="true" />
| improve this answer | |
3

Override catalog_product_view.xml and append into <body> tag following ;

<referenceBlock name="product.info.review" remove="true"/>
| improve this answer | |
  • I have overriderd product.info.review – Jaisa Dec 9 '17 at 8:46
  • see the updated post – Jaisa Dec 9 '17 at 8:49
  • It removes the tab, But failed to save the review in my custom template – Jaisa Dec 9 '17 at 8:50
  • 1
    I just needed to override 'reviews.tab' – 00-BBB Oct 4 '18 at 12:58
  • @00-BBB please ask a separate question for it, as if I answer it here other users would not be able to find it. You can link the question here. – Vivek Kumar Oct 4 '18 at 15:40
3

The best way to remove all reviews tabs on product page is to extend the Magento_Catalog folder from desing and create your own, building a child theme.

And inside layout/catalog_product_view.xml

Add this:

<referenceBlock name="reviews.tab" remove="true" />
        <referenceBlock name="product.review.form" remove="true" />
        <referenceBlock name="product.info.review" remove="true" />

Tested and working on Magento 2.3 as well.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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