add order line item args filter to wc api/cli set_line_item method

This commit is contained in:
Manos Psychogyiopoulos 2016-03-21 14:39:51 +02:00
parent cbb8fa9c66
commit 00b9887936
2 changed files with 4 additions and 0 deletions

View File

@ -979,6 +979,8 @@ class WC_API_Orders extends WC_API_Resource {
$item_args['totals']['subtotal_tax'] = floatval( $item['subtotal_tax'] );
}
$item_args = apply_filters( 'woocommerce_api_order_line_item_args', $item_args, $item, $order, $action );
if ( $creating ) {
$item_id = $order->add_product( $product, $item_args['qty'], $item_args );

View File

@ -986,6 +986,8 @@ class WC_CLI_Order extends WC_CLI_Command {
$item_args['totals']['subtotal_tax'] = floatval( $item['subtotal_tax'] );
}
$item_args = apply_filters( 'woocommerce_cli_order_line_item_args', $item_args, $item, $order, $action );
if ( $creating ) {
$item_id = $order->add_product( $product, $item_args['qty'], $item_args );