From c8d52c7c2d45c9dffec0276595fad78f83117245 Mon Sep 17 00:00:00 2001 From: Paul Kilmurray Date: Tue, 31 Mar 2015 18:36:27 +0800 Subject: [PATCH] Use wc_stock_amount format function This allows the REST API to honour the `woocommerce_stock_amount` filter, eg: for decimal quantity values --- includes/api/class-wc-api-orders.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/class-wc-api-orders.php b/includes/api/class-wc-api-orders.php index fcff4e65f11..a8b2fce138c 100644 --- a/includes/api/class-wc-api-orders.php +++ b/includes/api/class-wc-api-orders.php @@ -242,7 +242,7 @@ class WC_API_Orders extends WC_API_Resource { 'total' => wc_format_decimal( $order->get_line_total( $item, false, false ), $dp ), 'total_tax' => wc_format_decimal( $order->get_line_tax( $item ), 2 ), 'price' => wc_format_decimal( $order->get_item_total( $item, false, false ), $dp ), - 'quantity' => (int) $item['qty'], + 'quantity' => wc_stock_amount( $item['qty'] ), 'tax_class' => ( ! empty( $item['tax_class'] ) ) ? $item['tax_class'] : null, 'name' => $item['name'], 'product_id' => $product_id,