Pass id not object to wc_reduce_stock_levels

This commit is contained in:
Mike Jolley 2017-04-10 21:55:17 +01:00
parent 8fa73602eb
commit bcd39e9a79
2 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ abstract class WC_Gateway_Paypal_Response {
*/
protected function payment_on_hold( $order, $reason = '' ) {
$order->update_status( 'on-hold', $reason );
wc_reduce_stock_levels( $order );
wc_reduce_stock_levels( $order->get_id() );
WC()->cart->empty_cart();
}
}

View File

@ -213,7 +213,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
}
// Reduce stock levels
wc_reduce_stock_levels( $order );
wc_reduce_stock_levels( $order->get_id() );
// Remove cart
WC()->cart->empty_cart();