From c889908ac86198bc44a1838ebcd032aa65525026 Mon Sep 17 00:00:00 2001 From: claudiulodro Date: Mon, 25 Sep 2017 14:34:43 -0700 Subject: [PATCH] Load up gateways on ajax order status transitions --- includes/class-wc-ajax.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index 362f86ffba3..e829f9a1f17 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -459,6 +459,9 @@ class WC_AJAX { $status = sanitize_text_field( $_GET['status'] ); $order = wc_get_order( absint( $_GET['order_id'] ) ); + // Initialize payment gateways in case order has hooked status transition actions. + wc()->payment_gateways(); + if ( wc_is_order_status( 'wc-' . $status ) && $order ) { $order->update_status( $status, '', true ); do_action( 'woocommerce_order_edit_status', $order->get_id(), $status );