SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH SPECIAL OFFER: ENJOY 3 MONTHS OF SHOPIFY FOR $1/MONTH
How To Add Custom Tab To Product Page In Magento 2
Magepow.com

How to add custom tab in product page in Magento 2

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.

Now click on Add new attribute.

How to add custom tab in product page in Magento 2
Magepow.com

Set Default label as magepow and Attribute Code as magepow. Now click on Save Attribute.

We can see magepow attribute in list bellow

Step 2. Select or create attribute set.

Go to your Admin > Stores > Attributes > Attribute Set.

Drag and drop attribute magepow

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

How to add custom tab in product page in Magento 2
Magepow.com

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.

Done. I hope this articel will helpful for you.