Skip to content

Commit

Permalink
Prevent double stock quantity reduction (#8335)
Browse files Browse the repository at this point in the history
Co-authored-by: Miguel Gasca <miguel.gasca@automattic.com>
  • Loading branch information
RadoslavGeorgiev and mgascam authored Mar 14, 2024
1 parent b0f8650 commit aaa449f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog/fix-8292-reducing-stock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Preventing stock quantity from being reduced twice.
2 changes: 1 addition & 1 deletion includes/class-wc-payment-gateway-wcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ public function process_payment_for_order( $cart, $payment_information, $schedul
return $response;
}

wc_reduce_stock_levels( $order_id );
wc_maybe_reduce_stock_levels( $order_id );
if ( isset( $cart ) ) {
$cart->empty_cart();
}
Expand Down

0 comments on commit aaa449f

Please sign in to comment.