Merge pull request #16929 from woocommerce/fix/16802

Load up gateways on ajax order status transitions
This commit is contained in:
Mike Jolley 2017-09-26 14:39:31 +01:00 committed by GitHub
commit c59b122299
1 changed files with 3 additions and 0 deletions

View File

@ -460,6 +460,9 @@ class WC_AJAX {
$order = wc_get_order( absint( $_GET['order_id'] ) );
if ( wc_is_order_status( 'wc-' . $status ) && $order ) {
// Initialize payment gateways in case order has hooked status transition actions.
wc()->payment_gateways();
$order->update_status( $status, '', true );
do_action( 'woocommerce_order_edit_status', $order->get_id(), $status );
}