Check store api draft order on short code for reserved stock (#42796)
This commit is contained in:
parent
95c34a430d
commit
df1f5d9e45
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Shortcode cart checks for Store API reserved stock
|
|
@ -759,7 +759,7 @@ class WC_Cart extends WC_Legacy_Cart {
|
|||
public function check_cart_item_stock() {
|
||||
$error = new WP_Error();
|
||||
$product_qty_in_cart = $this->get_cart_item_quantities();
|
||||
$current_session_order_id = isset( WC()->session->order_awaiting_payment ) ? absint( WC()->session->order_awaiting_payment ) : 0;
|
||||
$current_session_order_id = isset( WC()->session->order_awaiting_payment ) ? absint( WC()->session->order_awaiting_payment ) : absint( WC()->session->get( 'store_api_draft_order', 0 ) );
|
||||
|
||||
foreach ( $this->get_cart() as $values ) {
|
||||
$product = $values['data'];
|
||||
|
|
Loading…
Reference in New Issue