01 02 03 04 05 06 07 08 09 10 11 | add_action( 'woocommerce_order_status_processing' , 'custom_autocomplete_order' ); function custom_autocomplete_order( $order_id ) { if ( ! $order_id ) { return ; } $order = wc_get_order( $order_id ); // get status $status = $order ->get_status(); if ( $status == 'processing' ) $order ->update_status( 'completed' ); } |