wc php get order get coupon discount amount
foreach( $order->get_coupon_codes() as $coupon_code ) { // Get the WC_Coupon object $coupon = new WC_Coupon($coupon_code); $discount_type = $coupon->get_discount_type(); // Get coupon discount type $coupon_amount = $coupon->get_amount(); // Get coupon amount }
Source: stackoverflow.com