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
  • This field is for validation purposes and should be left unchanged.

Related articles

Menu
Google Rating
5.0
Based on 58 reviews
×