• Resolved ohdearbambi

    (@ohdearbambi)


    Hello there, is there a way to make it so that when a customer pays for their orders via Wallet, the order status of that order will become ‘Payment received’ instead of ‘Processing’?

Viewing 1 replies (of 1 total)
  • Thread Starter ohdearbambi

    (@ohdearbambi)

    Whoops nevermind, managed to figure out the correct code to do this. If anyone is also experiencing something like this, this is the code that I’m using:

    add_action( 'woocommerce_order_status_changed', 'change_order_status_conditionally', 10, 4 );
    function change_order_status_conditionally( $order_id, $status_from, $status_to, $order ) {
        if( $order->get_payment_method() === 'wallet' && $status_to === 'processing') {
            $order->update_status( 'payment-received' );
        }
    }

    Do mind that I have already added the custom order status (payment received) prior to this.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.