Categories: Magento NewsProducts

A Quick Access To Create Custom Tab In Magento 2 Product Page Layout

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

The first, check how to create a simple module at

http://www.venustheme.com/how-to-create-magento-2-module/

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

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

2. Select a Attribute Sets for Magento 2 Product Page Layout

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

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="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="demo.tab" template="Ves_HelloWorld::custom_tab.phtml" group="detailed_info" >
    <arguments>
     <argument translate="true" name="title" xsi:type="string">Cutom Tab</argument>
    </arguments>
   </block>
  </referenceBlock>
 </body>
</page>

5. Create a template file

Go to this link:

app/code/Ves/HelloWorld/View/frontend/templates/custom_tab.phtml

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



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




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 for Magento 2 Product Page Layout

Admin Admin

Recent Posts

Streamoz Review 2025: What Twitch Growth Services Reveal About the Future of eCommerce Visibility

Daily, millions watch live streams on Twitch in the form of games, music, IRL content,…

21 hours ago

How Powerful Social Media Boosting Tools Like Jaynike Music Marketing Are Transforming eCommerce Marketing in 2025

In the contemporary setting of competitive musicality, even the most talented are having unspeakable trouble…

21 hours ago

TikTokstorm Review 2025: Powerful Social Media Boosting Tool Shaping the Future of eCommerce

In the dynamic world of eCommerce, visibility is everything. Whether you’re running a small Shopify…

22 hours ago

Top Magento 2 SEO Extensions to Supercharge Enterprise SEO in 2025

Magento 2 SEO Extensions are essential for enterprises in 2025 to boost visibility, optimize performance,…

7 days ago

Life Insurance In The Digital Age: How Technology Is Changing Protection

The best life insurance should always be about one thing: financial security for our loved…

1 week ago

Automation in the Workforce: 6 Essential Jobs That Will Stay and 6 at Risk

Automation in the Workforce: The Invisible Shift That's Already Here I’ve spent over a decade…

1 week ago