I created a custom tab and set it up by using layout instruction

<referenceBlock name="product.info.details">
        <block class="Magento\Catalog\Block\Product\View" name="custom.prod.tab2" template="MyComp_Mymod::customtab2.phtml" group="detailed_info" >
                <argument translate="true" name="title" xsi:type="string">More Info</argument>

The title of the tab needs to be value of a dropdown in the backend (dropdown attribute with multiple options) e.g. on product A the tab title could be ABC and on product B it could be XYZ whatever is selected in the backend.

Is there a way to pass on the selected dropdown value in the configuration here either through XML or via a variable through PHTML template ?


you can add something like that:

 <argument name="value" xsi:type="helper" helper="Vendor\module\Helper\Data::dev"/>

create this method dev and get current product object inside this method and return to that attribute value.

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.