My Custom product tab not displaying in Magento 2
Try this in your layout file
<referenceBlock name="product.info.details">
<block class="Magento\Catalog\Block\Product\View" name="mycustom.tab" as="mycustom" template="Test_ProductTabs::kit.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Kit Components</argument>
</arguments>
</block>
</referenceBlock>
product related details all are available in Magento\Catalog\Block\Product\View
so no need to create custom block for get product details.
update
wrong layout file location! it should be
Test/ProductTabs/view/frontend/layout/catalog_product_view.xml
You code is fine just simple mistake you have done two mistake
please change file name
catalog_product_view_.xml
to
catalog_product_view.xml
change frontend layout and tempplate file location
Test/ProductTabs/view/layout/catalog_product_view_.xml
to
Test/ProductTabs/view/frontend/layout/catalog_product_view.xml
change template file location
Test/ProductTabs/view/templates/kit.phtml
to
Test/ProductTabs/view/frontend/templates/kit.phtml
I think the better way to do this is to follow the same approach Magento uses to add the description
attribute as one of the tabs on the product details page.
First create your attribute, lets say it's tech_spec
and add it to whichever attribute sets you want it to so I can be updated from the Manage Manage Products page.
Then create/update your app\code[NameSpace][ModuleName]\view\frontend\layout\catalog_product_view.xml file with:
<referenceBlock name="product.info.details">
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.tech.spec" template="product/view/attribute.phtml" group="detailed_info">
<arguments>
<argument name="at_call" xsi:type="string">getTechSpec</argument>
<argument name="at_code" xsi:type="string">tech_spec</argument>
<argument name="css_class" xsi:type="string">tech-spec</argument>
<argument name="at_label" xsi:type="string">none</argument>
<argument name="title" translate="true" xsi:type="string">Technical Specification</argument>
</arguments>
</block>
</referenceBlock>
Alternatively if you don't want to add an attribute you can add a template instead.
<referenceBlock name="product.info.details">
<block class="Magento\Catalog\Block\Product\View" name="product.info.tech.spec" template="Magento_Catalog::product/view/tech-spec.phtml" group="detailed_info" >
<arguments>
<argument translate="true" name="title" xsi:type="string">Technical Specification</argument>
</arguments>
</block>
</referenceBlock>