Skip to content

Commit

Permalink
Use wc_stock_amount format function
Browse files Browse the repository at this point in the history
This allows the REST API to honour the `woocommerce_stock_amount` filter, eg: for decimal quantity values
  • Loading branch information
kilbot committed Mar 31, 2015
1 parent 634c198 commit c8d52c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/api/class-wc-api-orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function get_order( $id, $fields = null, $filter = array() ) {
'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,
Expand Down

0 comments on commit c8d52c7

Please sign in to comment.