I would like to change the woocommerce order status auotmatically from "on-hold" to "processing" for every new order, except for payment method BACS (Direct Bank Transfer). I already found this code, but do not know how to adapt it to exclude payments made with BACS.
add_action( 'woocommerce_thankyou', 'woocommerce_auto_processing_orders');
function woocommerce_auto_processing_orders( $order_id ) {
if ( ! $order_id )
return;
$order = wc_get_order( $order_id );
// If order is "on-hold" update status to "processing"
if( $order->has_status( 'on-hold' ) ) {
$order->update_status( 'processing' );
}
}
Thank you for your help!