Stock checks not required if stock levels have already been reduced. (#33575)
* Stock checks not required if stock levels have already been reduced. * Changelog.
This commit is contained in:
parent
45559775c9
commit
cd31ec0dd5
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Customers should be able to pay for orders so long as any required stock reductions have already taken place.
|
|
@ -138,6 +138,8 @@ class WC_Shortcode_Checkout {
|
|||
}
|
||||
}
|
||||
|
||||
// Stock levels may already have been adjusted for this order (in which case we don't need to worry about checking for low stock).
|
||||
if ( ! $order->get_data_store()->get_stock_reduced( $order->get_id() ) ) {
|
||||
foreach ( $order->get_items() as $item_key => $item ) {
|
||||
if ( $item && is_callable( array( $item, 'get_product' ) ) ) {
|
||||
$product = $item->get_product();
|
||||
|
@ -167,6 +169,7 @@ class WC_Shortcode_Checkout {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WC()->customer->set_props(
|
||||
array(
|
||||
|
|
Loading…
Reference in New Issue