fatBuzz
1/31/2018 - 8:58 AM

Auto complete WooCommerce orders

Add auto-complete.php to the theme's functions.php to auto complete all orders.

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( 'processing' );
}