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>
3
  • Your magento version..? 2.2.0 ? Dec 9, 2017 at 9:03
  • My version is magento 2.2.0
    – Jaisa
    Dec 9, 2017 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?
    – P S
    Dec 9, 2017 at 17:44

3 Answers 3

10

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

<referenceBlock name="reviews.tab" remove="true" />
6

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.

3

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

<referenceBlock name="product.info.review" remove="true"/>
6
  • I have overriderd product.info.review
    – Jaisa
    Dec 9, 2017 at 8:46
  • see the updated post
    – Jaisa
    Dec 9, 2017 at 8:49
  • It removes the tab, But failed to save the review in my custom template
    – Jaisa
    Dec 9, 2017 at 8:50
  • 1
    I just needed to override 'reviews.tab'
    – 00-BBB
    Oct 4, 2018 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. Oct 4, 2018 at 15:40

Your Answer

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

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