Use wc_stock_amount format function

This allows the REST API to honour the `woocommerce_stock_amount` filter, eg: for decimal quantity values
This commit is contained in:
Paul Kilmurray 2015-03-31 18:36:27 +08:00
parent 634c198341
commit c8d52c7c2d
1 changed files with 1 additions and 1 deletions

View File

@ -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' => wc_format_decimal( $order->get_line_total( $item, false, false ), $dp ),
'total_tax' => wc_format_decimal( $order->get_line_tax( $item ), 2 ), 'total_tax' => wc_format_decimal( $order->get_line_tax( $item ), 2 ),
'price' => wc_format_decimal( $order->get_item_total( $item, false, false ), $dp ), '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, 'tax_class' => ( ! empty( $item['tax_class'] ) ) ? $item['tax_class'] : null,
'name' => $item['name'], 'name' => $item['name'],
'product_id' => $product_id, 'product_id' => $product_id,