DataFirefly Order Vouchers — Full guide
Install and use the display of the promo codes used and the discount amount in the back-office orders list, for PrestaShop 8 and 9.
Overview and requirements
DataFirefly Order Vouchers adds two columns to the back-office orders list: the promo code(s) used on each order, and the total discount amount (formatted in the order currency). The module creates no table, writes nothing to the database and overrides no controller: it simply reads the vouchers already stored on your orders and displays them in the grid.
- Compatible with PrestaShop 8.0 to 9.x.
- PHP 7.4 to 8.3.
- Multistore and multilingual (FR/EN/ES/DE/IT).
- No file override: only the native hooks of the Symfony orders grid.
The data comes from the order_cart_rule and cart_rule tables. An order with no voucher simply shows an empty cell in both columns.
Installation
- Download the
dfordervouchers.ziparchive from your customer account. - In the back office, go to Modules > Module Manager.
- Click Upload a module and drop the archive.
- Installation registers the two orders-grid hooks. No configuration is required.
Right after installation, open Orders > Orders: the two new columns appear just after the “Total” column.
The module has no configuration page: it works immediately after installation, with no settings.
The two added columns
Promo code(s)
This column shows the code of each voucher actually applied to the order. When an order combines several codes, they are grouped, de-duplicated and comma-separated. Automatic promotions (code-less cart rules) are not shown in this column, since they have no code to display.
Discount
This column totals the amount discounted on the order, as stored at validation time (tax included by default), and shows it in the order currency. An order in pounds or dollars therefore shows its amount in its own currency. If no discount was applied, the cell stays empty.
How it works
From PrestaShop 1.7.7 onward, the orders list is powered by the Symfony grid. The module hooks into it through two official hooks:
actionOrderGridDefinitionModifier: adds the two columns to the grid definition, right after the “Total” column.actionOrderGridQueryBuilderModifier: enriches the grid query with two correlated sub-queries onorder_cart_ruleandcart_rule.
Because the sub-queries are correlated to the order ID, they produce no row duplication and do not conflict with the grid’s internal grouping. The amount reuses the currency already joined by the core in the grid query.
The module is read-only: it never writes to the database and never modifies any order. It can be installed and uninstalled with no impact on your data.
Edge cases
Several codes on one order
All codes are shown, comma-separated. The “Discount” column amount sums all the vouchers applied to the order.
Code-less automatic promotions
By default, the “Discount” column sums all reductions on the order, including any code-less automatic promotions. The “Promo code(s)” column only shows vouchers that have a code. A variant limiting the amount to coded vouchers only is available on request.
Multi-currency
The amount is always shown in the currency of the relevant order, reusing the currency joined by the native grid.
Multistore
The display respects the current back-office shop context, exactly like the native orders grid.
Sorting and customization
The labels of both columns are translatable through the PrestaShop module translation system, in all five languages. Since the grid’s native sorting relies on a whitelist of fields, clicking the header of these computed columns triggers no sorting but causes no error.
FAQ and troubleshooting
The columns don’t appear
Check that the module is installed and enabled in the Module Manager, then reload the Orders > Orders page. The columns appear just after the “Total” column.
The “Discount” column is empty while a code is shown
This can happen if the voucher stored on the order has a zero value, for instance a free-shipping voucher. The code stays displayed, but the discounted amount equals zero.
Does the module work on PrestaShop 8 and 9?
Yes. It relies on the Symfony orders grid present in both versions, through the official definition and query builder hooks.
What happens on uninstall?
Uninstalling simply removes the two hooks. Since no table was created and no data written, nothing is left in the database.