Include Coupon Codes on Invoice
-
Hi there…
I love this plugin, and I was trying to show the Coupons Codes used on the Invoices. I read a couple of previous post regarding the same subject, I used the code supplied but it doesn’t work for me.
This is the actual code that should show the Coupon Codes on the Invoice, but again, it doesn’t work for me. Is there anything I can do???
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 );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Include Coupon Codes on Invoice’ is closed to new replies.