Merge pull request #11533 from enricodeleo/master

Remove items from a pending order via rest api
This commit is contained in:
Claudio Sanches 2016-07-27 12:42:12 -03:00 committed by GitHub
commit 4d80528559
1 changed files with 1 additions and 1 deletions

View File

@ -1019,7 +1019,7 @@ class WC_REST_Orders_Controller extends WC_REST_Posts_Controller {
// Create item.
if ( is_null( $item['id'] ) ) {
$this->set_item( $order, $line_type, $item, 'create' );
} elseif ( $this->item_is_null( $item ) ) {
} elseif ( $this->item_is_null( $item ) || 0 === $item['quantity'] ) {
// Delete item.
wc_delete_order_item( $item['id'] );
} else {