Load up gateways on ajax order status transitions

This commit is contained in:
claudiulodro 2017-09-25 14:34:43 -07:00
parent 5427d0993b
commit c889908ac8
1 changed files with 3 additions and 0 deletions

View File

@ -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 );