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

Tags (1)
1 REPLY

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.