Use correct getter in legacy API for get_discount

Fixes #13635
This commit is contained in:
Mike Jolley 2017-03-17 14:37:19 +00:00
parent 476041698f
commit 8d0a4a3caf
3 changed files with 3 additions and 3 deletions

View File

@ -224,7 +224,7 @@ class WC_API_Orders extends WC_API_Resource {
$order_data['coupon_lines'][] = array(
'id' => $coupon_item_id,
'code' => $coupon_item->get_code(),
'amount' => wc_format_decimal( $coupon_item->get_discount_total(), 2 ),
'amount' => wc_format_decimal( $coupon_item->get_discount(), 2 ),
);
}

View File

@ -275,7 +275,7 @@ class WC_API_Orders extends WC_API_Resource {
$order_data['coupon_lines'][] = array(
'id' => $coupon_item_id,
'code' => $coupon_item->get_code(),
'amount' => wc_format_decimal( $coupon_item->get_discount_total(), $dp ),
'amount' => wc_format_decimal( $coupon_item->get_discount(), $dp ),
);
}

View File

@ -302,7 +302,7 @@ class WC_API_Orders extends WC_API_Resource {
$coupon_line = array(
'id' => $coupon_item_id,
'code' => $coupon_item->get_code(),
'amount' => wc_format_decimal( $coupon_item->get_discount_total(), $dp ),
'amount' => wc_format_decimal( $coupon_item->get_discount(), $dp ),
);
if ( in_array( 'coupons', $expand ) ) {