WooCommerce

Force WooCommerce Orders To Auto Complete

There are certain instances when a store owner wants orders to be automatically approved.

We’ve had to use this membership site (to auto enroll people in an online course) before and FooEvents (to automatically send people their tickets):

/**
 * Auto Complete all WooCommerce 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( 'completed' );
}

For more info, head to this website, specifically focused on WooCommerce: docs.woocommerce.com/document/automatically-complete-orders.

Need Help?

Tell us about your project!

  • Date Format: MM slash DD slash YYYY
Previous Post
Make Header Static On Page Until It Becomes Fixed
Next Post
Displaying Maps Inside Accordions, Tabs And Toggles

Related Articles

Menu
Google Rating
5.0
Based on 54 reviews
×
Get a Quote