Remove order_id param because order is not pending (see desc).

In the query inside method `wc_get_hold_stock_quantity` we have a clause of `status = wc_pending`. Call for this method here is already nested inside an `if` condition which checks that order is not pending. So this parameter is not needed here and only adds complexity to the final query.
This commit is contained in:
vedanshujain 2019-11-21 13:49:49 +05:30
parent e87024bb81
commit 882b441bfb
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ class WC_Shortcode_Checkout {
}
// Check stock based on all items in the cart and consider any held stock within pending orders.
$held_stock = ( $hold_stock_minutes > 0 ) ? wc_get_held_stock_quantity( $product, $order->get_id() ) : 0;
$held_stock = ( $hold_stock_minutes > 0 ) ? wc_get_held_stock_quantity( $product ) : 0;
$required_stock = $quantities[ $product->get_stock_managed_by_id() ];
if ( $product->get_stock_quantity() < ( $held_stock + $required_stock ) ) {