07-27-2023, 11:58 AM
In WooCommerce any order placed with the BACS (direct bank transfer) is set to **`"on-hold"`**.
How would one go about changing this automatically to processing?
I wan't it to work inside the **`functions.php`**
I have the following code but that doesn't work:
add_filter( 'woocommerce_payment_complete_order_status', 'rfvc_update_order_status', 10, 2 );
function rfvc_update_order_status( $order_status, $order_id ) {
$order = new WC_Order( $order_id );
if ( 'on-hold' == $order_status && 'on-hold' == $order->status ) {
return 'processing';
}
return $order_status;
}
Any help would be great!
How would one go about changing this automatically to processing?
I wan't it to work inside the **`functions.php`**
I have the following code but that doesn't work:
add_filter( 'woocommerce_payment_complete_order_status', 'rfvc_update_order_status', 10, 2 );
function rfvc_update_order_status( $order_status, $order_id ) {
$order = new WC_Order( $order_id );
if ( 'on-hold' == $order_status && 'on-hold' == $order->status ) {
return 'processing';
}
return $order_status;
}
Any help would be great!