Merge pull request #14188 from woocommerce/fix/14186
Correct calls to wc_reduce_stock_levels in PayPal and Simplify gateways
This commit is contained in:
commit
8bd7e2de4a
|
@ -66,7 +66,7 @@ abstract class WC_Gateway_Paypal_Response {
|
||||||
*/
|
*/
|
||||||
protected function payment_on_hold( $order, $reason = '' ) {
|
protected function payment_on_hold( $order, $reason = '' ) {
|
||||||
$order->update_status( 'on-hold', $reason );
|
$order->update_status( 'on-hold', $reason );
|
||||||
wc_reduce_stock_levels( $order_id );
|
wc_reduce_stock_levels( $order->get_id() );
|
||||||
WC()->cart->empty_cart();
|
WC()->cart->empty_cart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,7 +213,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reduce stock levels
|
// Reduce stock levels
|
||||||
wc_reduce_stock_levels( $order_id );
|
wc_reduce_stock_levels( $order->get_id() );
|
||||||
|
|
||||||
// Remove cart
|
// Remove cart
|
||||||
WC()->cart->empty_cart();
|
WC()->cart->empty_cart();
|
||||||
|
|
Loading…
Reference in New Issue