How to Add Rule Condition Field in Magento 2 Admin UI Component Form

The default Magento 2 offers the rule tree condition field using which the admin can configure the condition-based features.

For example, the admin may want to offer a discount coupon only on certain products or specific customer groups.

As online stores grow complex, the condition-based features are used more. Additionally, if you are customizing your own features for a better shopping platform, you may need to add rule condition field in Magento 2 admin UI component form as shown below.

How to Add Rule Condition Field in Magento 2 Admin UI Component Form 1

You can do so with the below code.

Method to Add Rule Condition Field in Magento 2 Admin UI Component Form:

Create [Vendor]/[Module]/view/adminhtml/layout/route_controller_grid.xml

That’s it.

Any doubts about the above solution? If so, do not hesitate to mention them in the Comments section below.

I’d be happy to help.

Also, do share the solution with Magento Community via social media.

Thank you.

4.7
(based on 7 Reviews)
How to Add Rule Condition Field in Magento 2 Admin UI Component Form

Milan Vaghela

Milan is a Magento Developer at Meetanshi. Apart from work, he plays cricket passionately. He loves reading books in his free time.

Leave a Reply

Your email address will not be published. Required fields are marked *