Skip to content

Commit

Permalink
Initialize payment gateways before running bulk actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Jun 12, 2018
1 parent ebcdd5f commit cca7972
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,9 @@ public function handle_bulk_actions( $redirect_to, $action, $ids ) {

// Sanity check: bail out if this is actually not a status, or is not a registered status.
if ( isset( $order_statuses[ 'wc-' . $new_status ] ) ) {
// Initialize payment gateways in case order has hooked status transition actions.
wc()->payment_gateways();

foreach ( $ids as $id ) {
$order = wc_get_order( $id );
$order->update_status( $new_status, __( 'Order status changed by bulk edit:', 'woocommerce' ), true );
Expand Down

0 comments on commit cca7972

Please sign in to comment.