I have added the custom attribute tab on the product page. If the tab is empty is must be hidden.
I have created an attribute customtab.
I have added below code in the catalog_product_view.xml inside body tag:
<referenceBlock name="product.info.details">
<block class="Magento\Catalog\Block\Product\View" name="customtab.tab" template="Magento_Catalog::customtab.phtml" group="detailed_info" >
<arguments>
<argument translate="true" name="title" xsi:type="string">Custom Tab</argument>
</arguments>
</block>
</referenceBlock>
How can I hide the custom attribute tab?
Best Answer
Try following code:
Note:
Add your html code in "if" condition, if html data found in tab content then tab will be display on the product page.