Menu Close
    Hire us Request quote Reading list Switch to dark mode

    Disable attribute in product edit admin panel in Magento 2

    Disable attribute in product edit admin panel in Magento 2

    Sometimes we might to disable attribute in product edit admin panel in Magento 2 like this –

    Attribute disabled

    In the screenshot we can see that the attribute has been disabled. We can make it hidden too. To achieve this, use the following code-

    In di.xml file inside app/code/Webkul/Module/etc/adminhtml/


    As we can see that we have provided a path, so we create a file Attributes.php in folder app/code/Webkul/Module/Ui/DataProvider/Product/Form/Modifier/. In file Attributes.php –


    You can see that we have put ‘disabled’ as true. This will disable the attribute.

    If you want to hide the attribute then in place of ‘disabled’ write ‘visible’ and in place of ‘true’ write ‘false’ so that visible becomes false and attribute will be hidden.

    I hope this helps.

    Happy coding 🙂

    . . .

    Comment

    Add Your Comment

    Be the first to comment.

    Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just received your message and our expert will get back to you shortly.
    Send Again
    Close