From 27b302b07547d5c34e31b46063696075073d1a30 Mon Sep 17 00:00:00 2001 From: Max Rice Date: Fri, 2 May 2014 15:26:30 -0400 Subject: [PATCH] Fix fee/coupon lines typo in REST API order response --- includes/api/class-wc-api-orders.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/api/class-wc-api-orders.php b/includes/api/class-wc-api-orders.php index e49c9a88061..cf4063a2819 100644 --- a/includes/api/class-wc-api-orders.php +++ b/includes/api/class-wc-api-orders.php @@ -214,7 +214,7 @@ class WC_API_Orders extends WC_API_Resource { // add fees foreach ( $order->get_fees() as $fee_item_id => $fee_item ) { - $order_data['fee_lines'] = array( + $order_data['fee_lines'][] = array( 'id' => $fee_item_id, 'title' => $fee_item['name'], 'tax_class' => ( ! empty( $fee_item['tax_class'] ) ) ? $fee_item['tax_class'] : null, @@ -226,7 +226,7 @@ class WC_API_Orders extends WC_API_Resource { // add coupons foreach ( $order->get_items( 'coupon' ) as $coupon_item_id => $coupon_item ) { - $order_data['coupon_lines'] = array( + $order_data['coupon_lines'][] = array( 'id' => $coupon_item_id, 'code' => $coupon_item['name'], 'amount' => wc_format_decimal( $coupon_item['discount_amount'], 2 ),