Describe the solution you’d like
I would like to be able to see the coupons used on each order in the order list view.
Like image attached
Describe alternatives you’ve considered
I have coded myself a solution:
add_filter( ‘manage_edit-shop_order_columns’, ‘create_coupon_column’ );
function create_coupon_column( $columns ) {
$new_columns = array();
foreach ( $columns as $column_key => $column_label ) {
if ( ‘order_total’ === $column_key ) {
$new_columns[‘order_coupons’] = __(‘Coupons’, ‘woocommerce’);
}
$new_columns[$column_key] = $column_label;
}
return $new_columns;
}
add_action( ‘manage_shop_order_posts_custom_column’ , ‘show_order_coupons’ );
function show_order_coupons( $column ) {
global $the_order, $post;
if( $column == ‘order_coupons’ ) {
if( $coupons = $the_order->get_coupon_codes() ) {
echo implode(‘, ‘, $coupons);
} else {
echo ‘-‘;
}
}
}
Open
Last updated: April 22, 2024
Log in to comment on this feature request.
Coupon visibility in the orders list is genuinely useful – spotting promotion usage at a glance before dispatch is much better than discovering it later.
A lightweight way to solve it is a simple Badger rule: “if a coupon is applied then add a badge”, so every coupon order is visible at a glance without clicks in both the order list view and detail page. That can be done easily with the OrderBadger plugin..