cancel
Showing results for 
Search instead for 
Did you mean: 

change in catalog_product_view.xml file

change in catalog_product_view.xml file

Hello,

I wanted in my product page

>to remove Reviews Tab,

>to remove related text "Be the First to review this product"

>to insert SKU

My original catalog_product_view.xml file contains the following data

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="page.main.title" destination="product.info.main" before="-"/>
        <move element="product.info.review" destination="product.info.main" after="page.main.title"/>
        <move element="product.price.final" destination="product.info.main" after="product.info.review"/>
        <referenceBlock name="product.info.sku" remove="true" />
     </body>
</page>

I changed the content to

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="page.main.title" destination="product.info.main" before="-"/>
        <move element="product.price.final" destination="product.info.main" after="page.main.title"/>
	<move element="product.info.sku" destination="product.info.main" after="product.price.final"/>
	<referenceBlock name="product.info.review" remove="true" />
	<referenceBlock name="reviews.tab" remove="true" />
    </body>
</page>

It is working.

I just want to know if this is OK to change the code like this?

Thanks

3 REPLIES 3

Re: change in catalog_product_view.xml file

Hello @bablupali

 

Yes, It's correct way to remove Review tab but make sure you have changed catalog_product_view.xml in your theme.

 

Thanks

If It's help's you, Click Kudos/Accept As solutions.

Re: change in catalog_product_view.xml file

hi guys , I'm using magento 2.3 and this file is not effecting anything on front-end.

i tried the code he shared but its not effecting anything

 

Re: change in catalog_product_view.xml file

Where is your xml file located?

it should be in app\design\frontend\<Vendor>\<theme>\Magento_Catalog\layout\catalog_product_view.xml