I have 4 custom tabs on the product detail page.

How to add the tag to the tab heading.


<block class="Magento\Catalog\Block\Product\View" name="magneticBallastTable.tab" template="VENDOR_Dvpage::tabs/content.phtml" group="detailed_info" >
                    <argument translate="true" name="title" xsi:type="string">Product Versions Comparison</argument>
                    <argument name="sort_order" xsi:type="string">70</argument>
| improve this question | | | | |

First you have to create a catalog_product_view.xml under 'MyVendor/MyModule/view/frontend/layout/' and add below code.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="product.info.main">            
            <block class="Magento\Framework\View\Element\Template" name="custom_product_detail" as="custom_product_detail" template="Solwin_AfterTest::tab.phtml" after="-"/>

Now, Create tab.phtml under 'MyVendor/MyModule/view/frontend/templates/' and add below script.

<script type="text/javascript">
    require(['jquery'], function () {
        jQuery(document).ready(function () {
            jQuery(".switch").each(function() {
                jQuery( this ).html('<h1>'+jQuery( this ).html()+'</h2>')
| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.