Contents
Hi everyone, today I will show you how to add custom tab in product page in Magento 2
Step 1. Add new attribute.
Go to your Admin > Stores > Attributes > Product.
Magepow.com
Now click on Add new attribute.

Set Default label as magepow and Attribute Code as magepow. Now click on Save Attribute.
Magepow.com
We can see magepow attribute in list bellow
Magepow.com
Step 2. Select or create attribute set.
Go to your Admin > Stores > Attributes > Attribute Set.
Magepow.com
Drag and drop attribute magepow
Magepow.com
Step 3. Configure Product Page
Now you can see the new attribute magepow on product edit page, updated the attribute set and click on save

Step 4. Create layout file.
In app/code/Magepow/CustomTab/view/frontend/layout, create catalog_product_view.xml and add the following code in the file:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="product.info.details">
<block class="Magento\Catalog\Block\Product\View" name="magepow.tab" template="Magepow_CustomTab::custom_tab.phtml" group="detailed_info" >
<arguments>
<argument translate="true" name="title" xsi:type="string">Custom Tab</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
Step 5. Create template file.
In app/code/Magepow/CustomTab/view/frontend/templates, create custom_tab.phtml and add the following code in the file:
<?php
$product = $block->getProduct();
?>
<h1><?php echo $product->getData('magepow'); ?></h1>
Go to you store font and check the result.
Magepow.com
Done. I hope this articel will helpful for you.