• Resolved apsred

    (@apsred)


    When user buy credit for wallet (via credit card), the order finish with COMPLETED status. That’s correct. But, when user buy and pay something with his wallet credit, the order finish with PROCESSING status. How to change this automatically to COMPLETED? i’ve tried this code in my functions.php, but it does not work:

    add_action(‘woo_wallet_payment_processed’, ‘woo_wallet_payment_processed_callback’, 10, 2);

    if(!function_exists(‘woo_wallet_payment_processed_callback’)){
    function woo_wallet_payment_processed_callback($order_id, $wallet_response){
    if($wallet_response){
    $order = wc_get_order($order_id);
    $order->set_status(‘completed’);
    }
    }
    }

    Thanks!

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

    you can try to use this plugin: https://www.ads-software.com/plugins/autocomplete-woocommerce-orders/

    It also gives you flexibility to apply autocomplete for some products only but for services for example you can choose not to set this option.

    I’m not affiliated with this plugin, I’m just user.

    Hope it helps.

    Thread Starter apsred

    (@apsred)

    Hi!

    Ok. I will try that until I wait for another answer.

    Thank you so much!

    Plugin Author Subrata Mal

    (@subratamal)

    Hi @apsred Please use bellow updated code and let us know.

    add_action('woo_wallet_payment_processed', 'woo_wallet_payment_processed_callback');
    if(!function_exists('woo_wallet_payment_processed_callback')){
        function woo_wallet_payment_processed_callback($order_id){
            $order = wc_get_order($order_id);
            $order->set_status('completed');
            $order->save();
        }
    }

    Thanks

    Thread Starter apsred

    (@apsred)

    It works! Thank you so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘‘COMPLETED’ status when buy with wallet credit’ is closed to new replies.