Merge pull request #5413 from maxrice/fix-rest-api-order-response

Fix fee/coupon lines typo in REST API order response
This commit is contained in:
Mike Jolley 2014-05-06 15:07:00 +01:00
commit 8c90915f09
1 changed files with 2 additions and 2 deletions

View File

@ -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 ),