Skip to content

Add new tab to product admin edit page, but for specific product type

Is it possible to add a new tab in the admin product edit page, but just for simple products? I was able to add a tab using ui_component, but I can’t figure out how to add this just for simple products

view/adminhtml/ui_component/product_form.xml
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="new_tab">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string">NEW TAB NAME</item>
                <item name="sortOrder" xsi:type="number">200</item>
                <item name="collapsible" xsi:type="boolean">true</item>
            </item>
        </argument>
        <insertListing name="new_tab_listing">
            <settings>
                <dataLinks>
                    <exports>false</exports>
                    <imports>true</imports>
                </dataLinks>
                <externalProvider>new_tab_listing.new_tab_listing_data_source</externalProvider>
                <autoRender>true</autoRender>
                <dataScope>new_tab_listing</dataScope>
                <ns>new_tab_listing</ns>
                <imports>
                    <link name="product_id">${ $.provider }:data.product.current_product_id</link>
                </imports>
                <exports>
                    <link name="product_id">${ $.externalProvider }:params.product_id</link>
                </exports>
            </settings>
        </insertListing>
    </fieldset>
</form>