Applied Rules
Composer package kowal/module-appliedrules · repository version 1.0.1
Product page
Description
This module surfaces the applied_rule_ids from sales orders in Magento Admin. It extends the Sales Order grid with an "Applied Rule IDs" column and adds a row in the order view details to display the same value.
For whom
Admin users who need quick visibility of which sales rules were applied to an order. This includes customer service, operations, and marketing teams validating promotions in the Admin panel.
Features
- Adds an "Applied Rule IDs" column to the Admin Sales Order grid (
sales_order_grid) using a UI component. - Extends the order grid collection in Admin by joining
sales_order.applied_rule_idsinto the grid query. - Renders Applied Rule IDs in the Admin order view under the Order Information block (shows “None” if empty).
- No custom configuration, no setup patches, and no new database schema/data changes.
- Depends on
Magento_Sales(module sequence).
Installation
* = in production please use the --keep-generated option
Type: Composer
-
Add the composer repository to the configuration:
composer config repositories.applied.rules vcs https://github.com/kowalco/applied-rules -
Add an access token for the private GitLab repository:
composer config --global --auth github-oauth.github.com <YOUR_TOKEN> -
Install the module using Composer:
composer require kowal/module-appliedrules -
Enable the module:
php bin/magento module:enable Kowal_AppliedRules -
Apply database updates:
php bin/magento setup:upgrade -
Flush the cache:
php bin/magento cache:flush
Configuration
There is no etc/config.xml or etc/adminhtml/system.xml, so the module has no Admin configuration and no scope (default/website/store view) settings to manage.
Requirements / notes
- Requires
Magento_Sales(module sequence). - No Composer dependencies are declared.
- Uses the existing
sales_order.applied_rule_idscolumn; if that column is missing or empty, the output will be empty/“None”. - Installation instructions in README include unclosed code fences; keep formatting consistent if you reuse them elsewhere.
Deployment and Operations
This module affects only Magento Admin (order grid and order view). After deployment and cache flush, the Applied Rule IDs will be visible in:
- Sales > Orders grid (column “Applied Rule IDs”).
- Sales > Orders > View (Order Information block row).
No cron jobs, queues, or indexers are introduced by this module.
Deployment Checklist
- Deploy code and install via Composer.
- Enable the module and run
setup:upgrade. - Flush Magento caches.
- Verify Admin order grid column and order view row are visible.
CI/CD and Environments
No environment-specific configuration is required. There are no additional build steps beyond standard Magento deployment for Admin UI changes.
Rollback
Rollback consists of removing or disabling the module and running standard Magento upgrade and cache flush. There are no module data patches or schema changes to revert.
Compatibility
No explicit Magento or PHP version constraints are declared in composer.json. Compatibility should align with Magento 2 installations that include the Magento_Sales module.
FAQ
- Where is the Admin configuration? There is none; the module does not add system configuration or ACL resources.
- Does it change the database schema or data? No. There are no setup scripts or patches in this module.
- Why don’t I see any Applied Rule IDs? If the order has no applied sales rules, the module renders “None”. If the column is empty in the database, nothing will display.
- Are there additional deployment steps? No, only standard module enablement and cache flush are required.
Verify the installation
bin/magento module:status Kowal_AppliedRules
Open an order with a cart price rule discount. Compare Applied Rule IDs on the order details page with the values in the orders grid.
Compare the stored identifier with the ID of the cart price rule used for the test. A coupon code and a rule ID are separate values.