Merge pull request #22646 from woocommerce/fix/22118

Fix Hold-stock behavior between simple products and variable products
This commit is contained in:
Mike Jolley 2019-02-05 10:37:45 +00:00 committed by GitHub
commit c7d2b1ac9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -310,7 +310,7 @@ function wc_get_held_stock_quantity( $product, $exclude_order_id = 0 ) {
AND posts.post_type IN ( '" . implode( "','", wc_get_order_types() ) . "' )
AND posts.post_status = 'wc-pending'
AND posts.ID != %d;",
'variation' === get_post_type( $product->get_stock_managed_by_id() ) ? '_variation_id' : '_product_id',
'product_variation' === get_post_type( $product->get_stock_managed_by_id() ) ? '_variation_id' : '_product_id',
$product->get_stock_managed_by_id(),
$exclude_order_id
)