Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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 by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #wc #php #order #coupon #discount #amount
ADD COMMENT
Topic
Name
9+6 =