Remove product review tab magento 2 năm 2024

Tabs are important to organize content and improve user experience. It avoids information overload and divides large content into easily readable relevant parts. For example, dividing product description, product images & product videos into 3 separate tabs will do much better from both user & search engine’s point of view than stuffing all of them in one tab.

For efficient display of information on a product page, following are the default Magento 2 tabs:

Details: Contains details about the product i.e. description, features, etc.

More Information Tab: Contains product attributes and values

Reviews: Contains customer reviews and add a review section

These product page tabs might not be enough if you want to display more product details in which case you would want to add more product info tabs. In this article, we will see how to add, rename and remove custom tabs from product page.

How to Add Tab to Product Page in Magento 2?

Before adding custom tabs, go through these tabs design guidelines compiled by Nielsen Norman Group.

Suppose you want to add new tab to product page in order to display information about the discounts you are offering on a particular product. To do so, first you need to create a new attribute from Magento admin and add it to default attribute set. Let’s say, you name this attribute Discounts.

Next, create a new template file. You can name it discounts-content.phtml.

Save it in:

app/design/frontend///Magento_Catalog/templates/product/view/

Add the following code.

helper('Magento\Catalog\Helper\Output'); $_product = $block->getProduct(); $_code = $block->getAtCode(); $_className = $block->getCssClass(); $_attributeLabel = $block->getAtLabel(); $_attributeType = $block->getAtType(); $_attributeAddAttribute = $block->getAddAttribute(); if ($_attributeLabel && $_attributeLabel == 'default') { $_attributeLabel = $_product->getResource()->getAttribute($_code)->getFrontendLabel(); } $_attributeValue = $_product->getResource()->getAttribute($_code)->getFrontend()->getValue($_product); ?>

>
The next step is to place the following code in our layout file catalog_product_view.xml.

getPackaging packaging packaging itemprop="packaging" Packaging content

How to Rename Product Info Tab in Magento 2?

If you want to change the name of a product page tab, you have to override the base layout file catalog_product_view.xml which is inside vendor/module_catalog folder. Create a new layout file and name it exactly the same as the base file. Go to

app/design/frontend//Magento_Catalog/layout/catalog_product_view.xml

and write the following code.

New Description

How to Remove Product Tabs in Magento 2?

This is very simple. The following code in the catalog_product_view.xml file removes the review tab.

 

Adding, renaming, or removing Magento 2 product page tabs in not that difficult of a task. With some custom CSS, you can further customize the look and feel of these tabs.

Magento 2 Product Tabs Extension – The Way Forward

Our Magento 2 product tabs extension has been developed to make the whole process of adding tabs an effortless exercise. It lets Magento 2 store owners add as many custom tabs as they require. They can also set the position for the tabs and assign them to specific products. Additionally, the extension empowers merchants to do the following.

  • Add unlimited custom tabs to product pages
  • Add variety of data types to custom tabs
  • Add related, cross-sell, up-sell products
  • Show tabs for a specific duration
  • Assign tabs to products by product attributes

Using the extension is pretty simple and allows you to make your pages/content more organized and engaging.

If you are facing any issue regarding adding, renaming or deleting Magento 2 product page tabs, don’t hesitate to contact our customer support.

How do I turn off reviews in Magento 2?

How to disable reviews in Magento 2. To disable reviews, navigate to the admin panel and go to Stores > Configuration > Catalog > Catalog > Product Reviews > Disable Reviews. Select Yes to turn off reviews. Your reviews and ratings will be removed from the product page.

How do I get rid of the more information tab in Magento 2?

Remove Magento 2 Tabs You can remove any block in Magento 2 using remove attribute. Define block name using reference block and set remove attribute value to true. See Common layout customization tasks in Magento official documentation.

How do I enable star rating in Magento 2?

Learn How to Enable Product Rating-Review in Magento 2.

Enable Product Rating in Magento 2..

Step1: Visit admin panel and tap on Stores > Rating..

Step2: Click on Add New Rating to rate your product in your store..

Step3: Enter the Default value in the given fields according to you..

How do I remove all products from a category in Magento 2?

1. Go to Catalog > Products and check the products you want to remove all categories for. 2. Select the Remove All Categories option from the mass actions dropdown and confirm you want to remove a product from all selected categories.