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

Shipping Rules That Reduce Support Tickets: Table Rate Shipping Setup Plus Proactive Delivery SMS Updates

Every ecommerce marketer knows the frustration: your inbox floods with "Where is my order?" messages…

2 days ago

5 Powerful Enterprise Software Development Companies in NYC You Should Know (2026)

When enterprise-scale projects demand flawless execution, the margin for error disappears. New York's business landscape…

2 days ago

10 Best API Integration Companies in the U.K. for Scalable Business Growth

In today’s digital-first economy, businesses rely heavily on seamless system connectivity to stay competitive. APIs…

4 days ago

Why U.S. businesses prefer to hire Salesforce developers for advanced CRM solutions

Across the United States, organizations are moving toward CRM ecosystems that support smarter customer engagement,…

4 days ago

Powerful AI Gigafactories: Transforming the Future of AI Startups and Enterprises

“Giga” is the term you must be unaware of; that’s why you came here to…

4 days ago

Why Is Testing Critical For E-commerce Applications?

E-commerce has changed the way we shop and conduct business. Today, most people prefer to…

1 week ago