• Resolved sillyninja

    (@sillyninja)


    Hello,
    I have enabled Cash on Delivery in woocommerce and added custom Order Status “COD” in woocommerce. I want if a user selects Cash on Delivery, the order will be added to COD option.

    Woocommerce already has a similarly option for pending payment as well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    Please add the below code in the functions.php file.

    add_filter( 'woocommerce_cod_process_payment_order_status', 'change_cod_payment_order_status', 10, 2 );
    function change_cod_payment_order_status( $order_status, $order ) {
        return 'wc-cod';
    }

    please make sure the return value is registered COD order status.

    Thank you

    Thread Starter sillyninja

    (@sillyninja)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add cash on delivery order in different order status?’ is closed to new replies.