Add a custom tab in product page Magento2


In this post, i will show you how to Add Custom Tab in Product Page Magento 2

The first, check how to create a simple module at

Add Custom Tab in Product Page Magento 2

1. Create new attribute in Magento 2 Add Custom Tab to Product Page

Go to this link:  admin > Store > Product > Add New Attribute

1. Create new attribute in

2. Select a Attribute Sets for the attribute

Go to this link: admin > Store > Attribute Set

You will drag and drop into one of the groups in Group block. For ex: to General tab

2.Select a Attribute Sets for the attribute

3. Update the new attribute for a product

3.Update the new attribute for a product

4. Create a layout file

Go to this link: app/code/Ves/HelloWorld/View/frontend/layout/catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
		<referenceBlock name="">
			<block class="Magento\Catalog\Block\Product\View" name="" template="Ves_HelloWorld::custom_tab.phtml" group="detailed_info" >
					<argument translate="true" name="title" xsi:type="string">Cutom Tab</argument>

5. Create a template file

Go to this link:


<?php // Get current product
$product = $block->getProduct();

<h1 style="color: #ff5501"><?php echo $product->getData('demo'); ?></h1>

5.Create a template file

Thank you for your attention about this Magento 2 Add Custom Tab to Product Page. If you have any question about this tutorial, please write your comment at the bottom page or watch more these below Related. Your comments will be supported professionally and effectively.

Related Tutorials & Magento 2