---
title: 'Applied Rules'
url: 'https://info.srv.kowal.co/docs/magento/modules/kowal-applied-rules'
markdown: 'https://info.srv.kowal.co/docs/magento/modules/kowal-applied-rules.md'
lang: en
date: '2026-11-29'
description: 'Use the Applied Rule IDs column in Sales > Orders to trace an order discount. Compare the IDs in the grid with the order details and the original cart price rule.'
taxonomy:
  category:
    - docs
    - Magento
    - Modules
  tag:
    - sales
    - admin
    - orders
---

# Applied Rules

Composer package **`kowal/module-appliedrules`** · repository version **1.0.1**

## Product page

[Applied Rules — kowal.co](https://kowal.co/magento-2-applied-rule-ids-column-in-orders)

## 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_ids` into 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

1. **Add the composer repository to the configuration:**

    ```bash

    composer config repositories.applied.rules vcs https://github.com/kowalco/applied-rules
    ```
2. **Add an access token for the private GitLab repository:**

    ```bash

    composer config --global --auth github-oauth.github.com <YOUR_TOKEN>
    ```
3. **Install the module using Composer:**

    ```bash

    composer require kowal/module-appliedrules
    ```
4. **Enable the module:**

    ```bash

    php bin/magento module:enable Kowal_AppliedRules
    ```
5. **Apply database updates:**

    ```bash

    php bin/magento setup:upgrade
    ```
6. **Flush the cache:**

    ```bash

    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_ids` column; 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

1. Deploy code and install via Composer.
2. Enable the module and run `setup:upgrade`.
3. Flush Magento caches.
4. 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

```sh
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.

---

## Navigation

- Parent: [Magento 2 Extensions](https://info.srv.kowal.co/docs/magento/modules.md)
- Previous: [Announcement Bar](https://info.srv.kowal.co/docs/magento/modules/announcement-bar.md)
- Next: [Automatic Related Products](https://info.srv.kowal.co/docs/magento/modules/automatic-related-products.md)
