Forum Replies Created

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

    (@kader1303)

    Hello this code solved my problem:

    add_action( ‘woocommerce_thankyou’, ‘custom_woocommerce_auto_complete_paid_order’, 999, 1 );
    function custom_woocommerce_auto_complete_paid_order( $order_id ) {
    // Only for ‘woo_credits’ payment gateway
    if ( ! $order_id || ‘woo_credits’ != get_post_meta($order_id, ‘_payment_method’, true) )
    return;

    // Get an instance of the WC_Order object
    $order = wc_get_order( $order_id );

    // Update order status back to ‘processing’
    $order->update_status( ‘processing’ );
    }

    Regards.

Viewing 1 replies (of 1 total)