magepsycho/magento2-salesordergrid

Enhanced Sales Order Grid

Maintainers

Package info

github.com/MagePsycho/magento2-sales-order-grid

Type:magento2-module

pkg:composer/magepsycho/magento2-salesordergrid

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-08-09 16:16 UTC

This package is auto-updated.

Last update: 2026-08-09 16:19:59 UTC


README

Magento 2 Enhanced Admin Order Grid

Magento 2 Enhanced Admin Order Grid

Packagist Version Packagist Downloads Supported Magento Versions License

Overview

Magento 2 Enhanced Admin Order Grid turns the stock sales order grid into a place you can actually work from — totals, colour, purchased items, customer IP and a statistics panel, all on the grid you already use.

Stock Magento gives you a flat table: no order total for the current filter, order status as grey text, no idea what was bought without opening each order, and single-value dropdown filters. This extension adds the columns and the aggregates on top of the same listing, so "how much is this filter worth", "what did they buy" and "which orders are stuck" are answerable without leaving the page.

Every addition is behind its own toggle, and behind a master switch — turn the extension off and the grid renders exactly like stock Magento, with no leftover empty columns.

Key Features

  • Total sales amount of the currently filtered records, with configurable display text and optional rounding
  • Colour-coded order status — configurable colour per status, optionally applied to the whole row
  • Purchase Items column — qty × name (SKU) per order, with optional product thumbnails
  • Statistics panel above the grid: KPI tiles, a per-day series and status/store breakdowns, all obeying the grid's current filters
  • IP Address column with optional X-Forwarded-For chain and click-to-lookup geolocation
  • Customer email linked straight to the customer edit page (guest orders stay plain text)
  • Coupon Code column, filterable like any other
  • Bulk delete orders directly from the grid, behind its own ACL resource
  • Multi-value filters on status, store and payment method, plus CSV / wildcard / range syntax on increment_id
  • Separate ACL resources for settings, statistics and bulk delete
  • Master kill-switch — one setting returns the grid to stock behaviour

Demo

Watch the Magento 2 Enhanced Admin Order Grid demo on YouTube

Watch the demo on YouTube

Feature Highlights

Enhanced sales order grid with statistics panel, status colours and purchase items

Total Amount Of What You Are Looking At

The grid footer shows the summed total of the records the current filter selects — not the page, and not the whole table. The text around the number is configurable and must carry the {{amount}} placeholder; anything else falls back to the default rather than rendering a label with no figure.

Colourful Order Status

Order status becomes a coloured badge instead of grey text, with a colour per status configured as dynamic rows. Twelve statuses ship with sensible defaults (pending orange, complete blue, canceled red, …); anything unconfigured renders transparent. Turn on Colorize Rows by Status to tint the whole row instead of just the cell.

Purchase Items

A Purchased Items column built server-side from sales_order_item, rendered as qty × name (SKU) lines with optional thumbnails. Name, SKU and image are independently toggleable, so the column can be as dense or as compact as you want.

The item lines are assembled with GROUP_CONCAT in the collection's _afterLoad(), and thumbnails are resolved once per product per request.

Statistics Panel

A panel above the grid showing KPI tiles (orders, revenue, AOV, today, pending, canceled), a per-day series and breakdowns by status and by store.

The numbers always match the grid. Rather than re-implementing filter handling, the panel rebuilds the sales_order_grid UI component server-side and borrows the collection it has already filtered — so date-range timezone conversion, multi-select filters, keyword search and this module's own increment_id syntax all apply identically, for free.

The grid collection joins sales_order_item and groups by entity_id, so one order can expand to several rows. The panel keeps that select as a derived table and aggregates outside it, which is what stops COUNT() and SUM() from multiplying.

Multi-Value And Range Filters

Stock dropdown filters accept one value. Here status, store and payment method accept several at once.

increment_id additionally understands three syntaxes:

Input Matches
100000011,100000012 either order
10000001% wildcard, % and _ both supported
100000011:100000020 inclusive numeric range

Leading zeros are ignored, and numeric forms are matched against CAST(increment_id AS UNSIGNED) so 9 finds 000000009.

IP Address And Geolocation

An IP Address column showing remote_ip, optionally followed by the X-Forwarded-For chain. With Enable IP Lookup on Click on, the address becomes a link that opens a geolocation popup; private ranges are recognised and not looked up.

Lookup is served by MagePsycho_GeoIp, a Composer dependency of this package. The XFF column is off by default — behind a proxy it is the honest client address, but it is client-supplied and should be read as a hint, not as evidence.

Access Control

ACL resources under MagePsycho:

  • MagePsycho_SalesOrderGrid::menu_config — Manage Settings
  • MagePsycho_SalesOrderGrid::statistics — see the statistics panel and its data endpoint
  • MagePsycho_SalesOrderGrid::delete — bulk delete orders

Bulk delete is destructive and irreversible — orders are removed, not cancelled. Grant ::delete deliberately.

ROADMAP

  • Add image support for "Purchase Items"
  • Color code rows in the grid to indicate order status at a glance
  • Bulk delete orders directly from the grid with ease
  • Display the IP address associated with each order in the grid
  • Enhance the filter functionality with the ability to filter orders by increment ID using:
    • Comma-separated values, such as 100000011,100000012
    • Wildcard operator, such as 10000001%
    • Range, such as 100000011:100000020

🛠️ Installation

1 Using Composer (Preferred)

composer require magepsycho/magento2-salesordergrid

2 Using Modman

modman init
modman clone git@github.com:MagePsycho/magento2-salesordergrid.git

3 Using Zip File

  • Download the Extension Zip File
  • Extract & upload the files to /path/to/magento2/app/code/MagePsycho/SalesOrderGrid/

Installing by zip or modman also needs MagePsycho_GeoIp for the IP lookup feature; Composer pulls it in automatically.

After installation by either means, activate the extension with following steps

  1. Enable the module
php bin/magento module:enable MagePsycho_SalesOrderGrid --clear-static-content
php bin/magento setup:upgrade
  1. Flush the store cache
php bin/magento cache:flush
  1. Deploy static content - in Production mode only
rm -rf pub/static/* var/view_preprocessed/*
php bin/magento setup:static-content:deploy
  1. Go to Admin > SALES > Enhanced Order Grid > Manage Settings

The extension creates no tables of its own — it reads sales_order_grid, sales_order_item and the catalog product media.

Configuration

Stores > Configuration > MagePsycho > Enhanced Order Grid, or Sales > Enhanced Order Grid > Manage Settings.

Enhanced Order Grid settings in the Magento admin

General Settings

Setting Default Purpose
Enabled Yes Master kill-switch — off returns the grid to stock behaviour
Debug Mode No Verbose logging

Grid Settings

Setting Default Purpose
Show Total Sales Amount Yes Total of the currently filtered records
Sales Amount Text | Total amount {{amount}} Must contain {{amount}}, else the default is used
Enable Price Rounding Yes Round the displayed total
Show Order Status Color Yes Status as a coloured badge
Order Status Colors 12 statuses preset Colour per order status
Colorize Rows by Status No Tint the whole row, not just the cell
Show Purchase Items Column Yes The purchased-items column
Show Item Image Yes Product thumbnails in that column
Include Item Name / Include SKU Yes / Yes What each line shows
Show IP Address Column Yes remote_ip column
Show X-Forwarded-For Chain No Append the XFF chain
Enable IP Lookup on Click Yes Geolocation popup on the address
Make Customer Email Clickable Yes Link to the customer edit page
Show Coupon Column Yes Coupon code column
Enable Bulk Delete Yes Bulk delete mass action

Statistics Panel

Setting Default Purpose
Show Statistics Panel Yes KPI tiles and charts above the grid
Default Period 30 days Period preselected in the per-day chart
Cache Lifetime (seconds) 300 0 disables caching; blank falls back to the default
Max Rows To Aggregate 500000 Guard against aggregating an unbounded result set

Every grid toggle is store-scoped. Settings control output only — the master switch decides whether this module participates at all.

Developer Notes

The statistics panel borrows the grid's own collection

Model\Statistics\SelectBuilder rebuilds the sales_order_grid UI component server-side, walks prepare() depth-first so the filters apply themselves, and reads the data provider's search result. The collection is never loaded — only its Select is read — so the GROUP_CONCAT in _afterLoad() and per-row thumbnail rendering never run for the statistics request.

Filter syntax lives in the collection

Model\ResourceModel\Order\Grid\Collection::addFieldToFilter() intercepts increment_id and rewrites CSV / wildcard / range input into IN, LIKE or BETWEEN against CAST(increment_id AS UNSIGNED). Numeric matching is deliberate: it makes 9 find 000000009 without the admin padding anything by hand.

Performance

Purchase items are built with GROUP_CONCAT per page of the grid, and thumbnails are memoised per request. On catalogs with very large orders, turning off Show Item Image is the cheapest win.

Tests and static analysis

vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist \
    app/code/MagePsycho/SalesOrderGrid/Test/Unit
vendor/bin/phpcs --standard=Magento2 --extensions=php,phtml \
    app/code/MagePsycho/SalesOrderGrid/
vendor/bin/phpstan analyse \
    -c dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon \
    --level=2 --memory-limit=2G app/code/MagePsycho/SalesOrderGrid/

Unit tests live in Test/Unit and cover the config fallbacks, the status-colour resolver, the statistics period source and the four custom grid columns.

Changelog

Version 1.1.0

  • Statistics panel, coupon code column, customer email link, IP address column with lookup, bulk delete.

Version 1.0.0

  • Initial Release.

Authors

  • Raj KB Twitter Follow

Contributors

Contributors

To Contribute

Any contribution to the development of Magento 2 Enhanced Admin Order Grid is highly welcome.
The best possibility to provide any code is to open a pull request on GitHub.

Need Support?

If you encounter any problems or bugs, please create an issue on GitHub.

Please visit our store for more FREE / paid extensions OR contact us for customization / development services.