Woocommerce : How to enable the automatically complete orders

Kindly follow the below steps for enable the autocomplete process for woocommerce product order.

Open the file in this path /wp-content/themes/theme-folder/function.php using some editor like DreamWeaver.

If you have activated the child theme then Open the file in this path /wp-content/themes/childtheme-folder/function.php using some editor like DreamWeaver and append the below code.

/*
* 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' );
}

Rate This Article

(4 out of 12 people found this article helpful)

Leave A Comment?

This site uses Akismet to reduce spam. Learn how your comment data is processed.