Join

Autocomplete WooCommerce Orders

Don't want to mess with guides or code snippets? This is a feature of MyListing Pro.

The question, “Why are all my orders stuck with processing status?” comes up quite often.

In some cases, it’s fine to leave MyListing orders with a “processing” status, but some important processes require an order to have a “completed” status. Automations within CRMs are just one example of this.

The code snippet below will automatically complete orders for all virtual/downloadable products.

PHP
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
    if ( ! $order_id ) {
        return;
    }

    $order = wc_get_order( $order_id );
    $order->update_status( 'completed' );
}