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/
Table of Contents
Go to this link: Â admin > Store > Product > Add New 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
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>
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.
Your online store is growing, but your platform isn't. That slow checkout process, those missing…
High-performing websites look appealing and help users navigate through content with intent. Many websites look…
Do you remember when the internet was all dial-up noises and static websites? How times…
Global buyers & e-commerce trends are transforming how businesses operate in the digital age.The trend…
Businesses are always looking for effective ways to attract new customers, generate high-quality leads, and…
Automated vs Manual Mobile App Testing is a crucial consideration for businesses aiming to deliver…