• Resolved bigshoeinc

    (@bigshoeinc)


    An invoice is created via the WooCommerce Shop.
    Woo Invoices creates the invoice and emails it.
    Client pays the invoice via the PayPal link on the Invoice page.
    The Invoice status is Paid but Woo Commerce status remains as Invoice.

    I believe I need a code snippet to make WooCommerce Status to change from Invoice to Completed.

    • This topic was modified 4 years, 10 months ago by bigshoeinc.
Viewing 1 replies (of 1 total)
  • Thread Starter bigshoeinc

    (@bigshoeinc)

    I found the solution!!

    // client makes a successful payment on an invoice
    // Update the woocommerce status after payment made

    add_action( ‘sliced_payment_made’, ‘sliced_woocommerce_set_order_status_2018_08_17’, 10, 3 );
    function sliced_woocommerce_set_order_status_2018_08_17( $id, $gateway, $status ) {
    if( $status === ‘success’ ) {
    $order_id = get_post_meta( $id, ‘_sliced_invoice_woocommerce_order’, true );
    if( $order_id ) {
    // update woocommerce order status to ‘completed’
    $order = new WC_Order($order_id);
    $order->update_status(‘completed’);
    } else {
    return; // not tied to woocommerce order
    }
    }
    }

Viewing 1 replies (of 1 total)
  • The topic ‘How to get Woo Invoices to change WooCommerce status after Woo Invoice is paid’ is closed to new replies.