josk79

josk79 supports this item

Supported

This author's response time can be up to 10 business days.

61 comments found.

Hi,

When using the WooCommerce Coupon, I can add the coupons used like this: add_action( 'woocommerce_admin_order_data_after_billing_address', 'testing', 10, 1 ); function testing($order){ if( $order->get_used_coupons() ) { $coupons_count = count( $order->get_used_coupons() ); echo '<h4>' . __('Coupons used') . ' (' . $coupons_count . ')</h4>'; echo '<p><strong>' . __('Coupons used') . ':</strong> '; $i = 1; $coupons_list = ''; foreach( $order->get_used_coupons() as $coupon) { $coupons_list .= $coupon; if( $i < $coupons_count ) $coupons_list .= ', '; $i++; } echo '</p><p><strong>Coupons used (' . $coupons_count . ') :</strong> ' . $coupons_list . '</p>'; } } But when using this awesome plugin, how can I do the same? I really need it to display on the orders page and some other areas.

Will work just the same with this plugin enabled.

Sadly it always returns empty on the first if check. So it does not work with the plugin. I’ve checked it towards orders with coupons and without. Both return the same on: if( $order->get_used_coupons() )
by
by
by
by
by
by