How to add a custom tab in Magento 2 on the products page

We need to create a custom module for that.

How to add a custom tab in Magento 2 on the products pageexpoundsofttechsolution How to add a custom tab in Magento 2 on the products page

Create the folder in app/code/Ests/ProductTab and create the file registration.phtml

add the below code in registration.phtml file

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
	\Magento\Framework\Component\ComponentRegistrar::MODULE,
	'Ests_ProductTab',
	__DIR__
);

Create another folder in app/code/Ests/ProductTab/etc and create the file module.xml

add the below code in the module.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Ests_ProductTab" setup_version="1.0.0"> </module>
</config>

Create another folder in app/code/Ests/ProductTab/view/frontend/layout and create the file catalog_product_view.xml

add the below code in the catalog_product_view.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" 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="shipping.tab" template="Ests_ProductTab::custom.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">custom tab</argument>
<argument name="sort_order" xsi:type="string">100</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>

Create another folder in app/code/Ests/ProductTab/view/frontend/templates and create the file custom.phtml

add the below code in the file custom.phtml

<?php
$product = $block->getProduct();
?>
<h1><?php echo $product->getData('enter the attribute name here');?><br></h1>