Merge pull request #13647 from woocommerce/fix-13635

Use correct getter in legacy API for get_discount
This commit is contained in:
Mike Jolley 2017-03-17 15:35:56 +00:00 committed by GitHub
commit 725c153d0c
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 ) ) {