0

My code was working fine for Magento 2.1 but in 2.2 suddendly product tab is not coming in magento admin on product edit page. below is my layout file:-

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product_form">
            <block class="W3solver\Qrcode\Block\Adminhtml\Catalog\Product\Edit\Tab\Qrcode" name="qrcode.tab">
                <arguments>
                    <argument name="config" xsi:type="array">
                        <item name="label" xsi:type="string" translate="true">Qrcode</item>
                        <item name="collapsible" xsi:type="boolean">true</item>
                        <item name="opened" xsi:type="boolean">false</item>
                        <item name="sortOrder" xsi:type="string">191</item>
                        <item name="canShow" xsi:type="boolean">true</item>
                        <item name="componentType" xsi:type="string">fieldset</item>
                        <item name="group_code" xsi:type="string">advanced</item>
                        <item name="dataScope" xsi:type="string"></item>
                    </argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

In W3solver\Qrcode\Block\Adminhtml\Catalog\Product\Edit\Tab\Qrcode file

When I tried to debug then it works till constructor but later its not working. Is there any change with Magento 2 which can result in such issue?

0

Try to use below code in your module then 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">
    <htmlContent name="qrcode" sortOrder="22">
        <argument name="data" xsi:type="array">
            <item name="wrapper" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Qrcode</item>
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="opened" xsi:type="boolean">false</item>
            </item>
        </argument>
        <settings>
            <wrapper>
                <canShow>true</canShow>
                <componentType>fieldset</componentType>
            </wrapper>
        </settings>
        <block class="W3solver\Qrcode\Block\Adminhtml\Catalog\Product\Edit\Tab\Qrcode" name="qrcode">
            <arguments>
                <argument name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Qrcode</item>
                    <item name="collapsible" xsi:type="boolean">true</item>
                    <item name="opened" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="string">191</item>
                    <item name="canShow" xsi:type="boolean">true</item>
                    <item name="componentType" xsi:type="string">fieldset</item>
                    <item name="group_code" xsi:type="string">advanced</item>
                    <item name="dataScope" xsi:type="string"></item>
                </argument>
            </arguments>
        </block>
    </htmlContent>
</form>

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.