Support » Plugin: License Manager for WooCommerce » change the order status to completed after approve in the payment confirmation

  • I want to change the order status to completed after press the button approve in the payment confirmation

    is it a code like this?
    Put it on and it doesn’t work.
    Or at what step did you make a mistake?

    add_filter( 'woocommerce_payment_complete_order_status', 'rfvc_update_order_status', 10, 2 );
     
    function rfvc_update_order_status( $order_status, $order_id ) {
     
     $order = new WC_Order( $order_id );
     
     if ( 'processing' == $order_status && ( 'on-hold' == $order->status || 'pending' == $order->status || 'failed' == $order->status ) ) {
     
     return 'completed';
     
     }
     
     return $order_status;
    }

    1) Start as => on-hold status
    2) When someone transfers money to => Checking payment
    3) When approved in payment confirmation, the payment change => Processing.

    I want to press the button approve in the payment confirmation and chage to completed status

    how can i do that

    • This topic was modified 2 weeks, 2 days ago by youdsan.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.