WooCommerce change order status BACS processing

后端 未结 3 617
无人及你
无人及你 2021-01-01 03:29

In WooCommerce any order placed with the BACS (direct bank transfer) is set to \"on-hold\".

How would one go about changing this automa

3条回答
  •  醉梦人生
    2021-01-01 03:55

    Try changing the code to this:

    function rfvc_update_order_status( $order_status, $order_id ) {
        $order = new WC_Order( $order_id );
        if ( 'on-hold' == $order_status && 'on-hold' == $order->status ) {
            $order->update_status('processing', 'order_note');
        }
        return $order_status;
    }
    

    The key change here is this:

    $order->update_status('processing', 'order_note');
    

    You can add order note too if you prefer.

提交回复
热议问题