Merge pull request #6552 from Aaron3/patch-1

Fixed API create_order to allow setting line totals.
This commit is contained in:
Mike Jolley 2014-10-16 16:53:18 +01:00
commit dfa4f8b63a
1 changed files with 4 additions and 4 deletions

View File

@ -864,22 +864,22 @@ class WC_API_Orders extends WC_API_Resource {
// total
if ( isset( $item['total'] ) ) {
$item_args['totals']['line_total'] = floatval( $item['total'] );
$item_args['totals']['total'] = floatval( $item['total'] );
}
// total tax
if ( isset( $item['total_tax'] ) ) {
$item_args['totals']['line_tax'] = floatval( $item['total_tax'] );
$item_args['totals']['tax'] = floatval( $item['total_tax'] );
}
// subtotal
if ( isset( $item['subtotal'] ) ) {
$item_args['totals']['line_subtotal'] = floatval( $item['subtotal'] );
$item_args['totals']['subtotal'] = floatval( $item['subtotal'] );
}
// subtotal tax
if ( isset( $item['subtotal_tax'] ) ) {
$item_args['totals']['line_subtotal_tax'] = floatval( $item['subtotal_tax'] );
$item_args['totals']['subtotal_tax'] = floatval( $item['subtotal_tax'] );
}
if ( $creating ) {