I was having the same problem and managed to write this:
function example_custom_order_fields( $fields, $order ) {
$new_fields = array();
$coupon_codes = $order->get_coupon_codes();
$coupons_string = '';
foreach($coupon_codes as $coupon){
$coupons_string .= $coupon.', ';
}
$new_fields[0] = array(
'label' => 'Coupon Code(s)',
'value' => $coupons_string
);
return array_merge( $fields, $new_fields );
}
add_filter( 'wcdn_order_info_fields', 'example_custom_order_fields', 10, 2 );
I originally wanted to list the coupons (just the names/codes) in the bottom of the invoice below the Subtotal line, like how it lists SKUs under Product names. However, this code just adds the coupon codes to the order info section, below Order Date and Payment Method. This seems like the best method for adding the coupon codes without editing the plugin files directly.
Let me know if you found a different solution.