Magento custom module development is a core part of any Magento development project because it helps to fulfill business needs by adding custom functionality to Magento store using a module. Magento contains so many built-in features some of which you will probably never know which makes it stand out from the list of CMS’s. Magento owns special filter for choosing products or order for promotions called rule conditions. It offers types of conditions, one is catalog rule condition used to create a filter for products in Magento and other is shopping cart rule condition to create a filter for orders.

Recently while working with one of the Magento custom development projects, we came across the requirement of adding shopping cart rules to admin form to give a personalized touch by satisfying client needs. Shopping cart price rules help to create an action for orders at the checkout level, based on a set of conditions.

Firstly, we need to create ‘rules.php’ file along with the following code at below location that contains set of defined rules.

app\code\local\Vendor\Extension\Model\Rules.php

After that, we need to create another file ‘Conditions.php’ at following path that helps to create admin form in custom extension.

app\code\local\Vendor\Extension\Block\Adminhtml\Extension\Edit\Tab\Conditions.php

Lastly, we need to create ‘ExtensionController.php’ at below location to create multiple actions and control activities.

 app\code\local\Vendor\Extension\controllers\Adminhtml\ExtensionController.php

Once you have added this code to your extension, you are done. It will start displaying rules in backend admin form.

Not only this you can even customize this code as per your need.

Lastly, Comment down below if you need any help regarding this code.

Happy Coding!

Click to rate this post!
[Total: 4 Average: 3]