How to Add Custom Tab in Product Detail page Magento2

In this instructional exercise, I will clarify to how to include custom
tab in product detail page in Magento 2. By default, there are 3 tabs
show in product detail page. Details, More Information & Review Tab. You
must then customise the page if you wish to add extra tabs.
you would like to create new file
and paste the underneath code :

<referenceBlock name="">
     <block class="Magento\Catalog\Block\Product\View"
             <argument translate="true" name="title"
 xsi:type="string">Demo Tab</argument>
             <argument name="sort_order" xsi:type="string">10</argument>

After that, ought to make file
app/code/Vendor_Name/Module_Name/view/frontend/templates/product/view/custom.phtml and now add content that custom tab with the content you want to display. Additionally, you can provide the sort order of a custom tab, which will cause it to display in the proper order according to the sort order value you choose.

<span>This is Demo tab</span>

I hope this article on adding a custom tab to
the Magento 2 product detail page is simple to grasp.

If you still have any issue feel free to ask and let me know your views to make the better. Share this solution with your other Magento buddies via social media.

Thanks for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *