WooCommerce: Automatically Complete all Orders

By default, WooCommerce orders are saved as Processing. Only orders that contain “downloadable” products are automatically completed upon payment. In case you sell virtual products you may want to automatically complete all orders as they arrive, saving you a lot of time by not manually approve/complete orders.

There are some plugins available you can use to let WooCommerce process orders automatically if the they payment is complete. However, there is an easier way to do this by using a snippet. Just add the following code to the end of your functions.php file which is located in “wp-content/themes/your-theme-name/”, or  “wp-content/themes/your-child-theme-name/” if you are using a child theme:

The above method works only for online payments (PayPal and Credit cards gateway payments). If you are using BACS (direct bank transfer), Cheque or COD (cash on delivery) payment methods  you would need to implement a conditional code based on selected payment method – i.e. if the selected payment method IS NOT BACS, COD or Cheque then apply the above snippet to automatically complete order.

Using the above updated snippet the BACS, COD and Cheque payment methods will be ignored and keep their original status, and will automatically complete orders for paid orders only.

 

No comments yet.

Leave a Reply