Home > WooCommerce > Docs > How to AutoComplete Orders in WooCommerce

How to AutoComplete Orders in WooCommerce

Last updated: September 01, 2024
Written and researched by experts at AvadaLearn more about our methodology

By Sam Nguyen

CEO Avada Commerce

As a WooCommerce store owner, you should strive to improve customer experience as much as possible. One of the effective measures that could help you achieve that is to optimize the WooCommerce checkout process.

With this in mind, in today’s article, we will give you comprehensive instructions on how to autocomplete orders in WooCommerce.

Why Do You Need to AutoComplete Orders in WooCommerce?

  • If your customers want your product immediately, keeping the order pending for hours or even days before it is verified would certainly cause them to cancel the order before payment has been made.

  • Enabling the autocompletion of orders in your WooCommerce store allows you to process and complete orders quickly, enabling your customers to access their items in just a few minutes.

  • Not only will autocompleting orders save you time and labor, but it will also speed up the checkout process and increase your revenues, especially if you offer virtual or downloadable products.

  • Customers’ overall shopping experience will improve.

How to AutoComplete Orders in WooCommerce?

In this part, we will show you how to autocomplete WooCommerce orders. In general, there are two methods that you can approach, namely, using a plugin and using PHP code snippets.

Method 1: Using a Plugin

The plugin we use in this tutorial is called Autocomplete WooCommerce Orders .

Autocomplete WooCommerce Orders

This plugin is a highly safe and user-friendly method of processing orders while also verifying transactions on your accounts. With this dedicated tool, you can automatically complete orders for all of your virtual and downloadable items while confirming payments.

Furthermore, it utilizes PayPal Identity Tokens to ensure that you will only autocomplete paid orders. This offers the highest level of security for both you and your clients. Moreover, this tool allows your customers to purchase products without having to fill out all of their checkout information each time.

Now, without further ado, let’s learn how to enable the autocompletion of WooCommerce orders using a plugin.

Step 1: Install and activate the plugin

First of all, you go to your WordPress admin dashboard > Plugins > Add New. After that, you need to search for the plugin by typing Autocomplete WooCommerce Orders in the search bar, which is on the top right.

Then, click on Install and Activate to finish the installation process.

Install and activate the plugin

Step 2: Set up the plugin

Go to WooCommerce > Settings > AutoComplete orders to open your AutoComplete Orders setting.

Set up the plugin

There are 3 different modes you can select from the menu to set for the plugin:

  • Paid Orders of Virtual Products only
  • All paid orders of any product
  • Any order (paid or unpaid)

Set up the plugin

The mode you select here will define how the plugin autocompletes your WooCommerce orders, therefore, you need to carefully consider this mode setting. If you choose the option Paid Orders of Virtual Products Only, the plugin will only autocomplete orders for virtual products whose payments have been validated.

Step 3: Set up PayPal Data Token

PayPal tokens are simple tokens that can be acquired from your PayPal account and used to facilitate secure autocomplete orders. With this token, PayPal can easily detect when your customers purchase your virtual items and verify it with the Autocomplete plugin.

Thus, in this step, you have to get your PayPal Data Transfer token.

  1. Log in to your PayPal account.

PayPal account

  1. Click on the button Settings

Settings

  1. Click on the tab Sellers tools. Under the section Website preferences, click on Update.

Sellers tools

  1. Scroll down to the Auto return section. You need to turn on the Auto Return to enable the Payment Data Transfer feature.

  2. After that, you will see a field where you can add your Return URL page. You need to choose this URL carefully because this is also the page where your customers will be sent to after they have completed their checkout process.

Return URL

  1. Once adding the Return URL page, click on the button Save. Then, you just need to scroll down a little bit to access your PayPal Data Transfer token. You will need to turn this feature on and copy your *Identity token**.

Identity Token

  1. Now, from your WordPress admin dashboard, go to WooCommerce > Settings > Payments.

Payments

Then, click on Manage under the PayPal section to open your PayPal settings for WooCommerce.

PayPal

  1. Go to the section PayPal identity token and paste the Identity token that you have just copied in 6.

  2. You also need to set up other PayPal settings here to offer your customers the best checkout experience possible. When you’re done, remember to click Save changes.

Other settings

And that’s all you need to do to autocomplete WooCommerce orders.

Method 2: Using PHP code snippets

This technique is ideal for people who have coding skills but do not want to install any additional plugins on their site.

Step 1: Open Theme editor

First of all, from your WordPress dashboard, go to Appearance > Theme Editor to open your Theme editor.

Open Theme editor

After that, under the Theme files sidebar, you click on the Theme functions file on the far right.

Theme functions file

This is your functions.php file, and it will allow you to add custom functions to your WordPress website.

Step 2: Paste the PHP code

Under the functions.php file, you paste the PHP code below to enable the autocompletion of orders for all of your WooCommerce virtual products.


<?php

add_filter( 'woocommerce_payment_complete_order_status', 'auto_complete_virtual_orders', 10, 3 );

function auto_complete_virtual_orders( $payment_complete_status, $order_id, $order ) {
$current_status = $order->get_status();
// We only want to update the status to 'completed' if it's coming from one of the following statuses:
$allowed_current_statuses = array( 'on-hold', 'pending', 'failed' );

if ( 'processing' === $payment_complete_status && in_array( $current_status, $allowed_current_statuses ) ) {

$order_items = $order->get_items();

// Create an array of products in the order
$order_products = array_filter( array_map( function( $item ) {
// Get associated product for each line item
return $item->get_product();
}, $order_items ), function( $product ) {
// Remove non-products
return !! $product;
} );

if ( count( $order_products > 0 ) ) {
// Check if each product is 'virtual'
$is_virtual_order = array_reduce( $order_products, function( $virtual_order_so_far, $product ) {
return $virtual_order_so_far && $product->is_virtual();
}, true );

if ( $is_virtual_order ) {
$payment_complete_status = 'completed';
}
}
}
return $payment_complete_status;
}


Paste the PHP code

Step 3: Update file

Finally, click on Update file to finish the autocompletion of orders for virtual products.

And that’s how you autocomplete orders in WooCommerce using PHP code snippets.

In this part, we have compiled the four highly recommended plugins that could help you enable autocomplete WooCommerce orders. Let’s check them out!

1. Automatic Payment Status WooCommerce

Automatic Payment Status WooCommerce

Automatic Payment Status for WooCommerce allows you to change the order status to ‘completed’ quickly, saving your clients a lot of time during checkout. Therefore, you can immediately autocomplete all of your paid orders.

Features

  • Autocomplete WooCommerce orders for products with the following status: No changes; for orders with at least one virtual product; for orders with virtual products only; all orders (paid or otherwise).

  • Send customers only one email notification with only one status change ‘Completed’.

Pricing

The single-site license costs you $29 one time.

2. WooCommerce Order Status Control

WooCommerce Order Status Control

WooCommerce Order Status Control is a native WooCommerce plugin that gives you more control over autocompleting orders. This plugin allows you to automatically complete any of your paid WooCommerce products without any human interaction.

You can ease the operation of your online store by autocompleting orders. You have the option of enabling this for all paid orders or only the virtual ones. WooCommerce Order Status Control is extremely simple to use and will save you and your customers enormous time.

Features

  • Automatically label paid orders as ‘completed’ rather than ‘processing.’

  • Select which paid WooCommerce orders are processed automatically.

  • Easy integration

Pricing: $29 per year

3. WooCommerce Auto Complete Virtual Orders

WooCommerce Auto Complete Virtual Orders

If you have a website with a lot of virtual items, then this is the plugin for you. This premium plugin includes all of the functionality you’ll need to allow automatic processing of your paid orders.

Features

  • Autocomplete products with zero settings for both free and paid purchases.

  • Eliminate the need to manually validate all of your virtual items’ orders.

  • Full WooCommerce Subscriptions compatibility, enabling you to implement autocomplete orders for your subscription services.

Pricing

The single site license is charged at $19 per year. The one-time payment for a single site license with lifetime support and update costs you $59.

4. WunderAutomation

WunderAutomation

WunderAutomation takes a unique approach to order completion. It functions similarly to Zapier or IFFT tools in the way that it automates specific WooCommerce and WordPress tasks for you.

You can configure WunderAutomation to change the order status of any WooCommerce virtual orders to ‘completed’ immediately if you want greater in-depth control over autocompleting WooCommerce orders. Its adaptable approach to autocompleting orders allows you to insert additional conditions and inspections.

Features

  • Extensive control over auto-completing WooCommerce orders
  • Add additional conditions and checks
  • Include extra actions such as an order note and a personalized email to the customer
  • More than 20 triggers, 30 filters, 8 actions, 50 parameters
  • Support both incoming and outgoing Webhooks

Pricing: Free

Final Words

Autocompleting orders in your store will allow you to deliver a better customer experience and also increase revenue. In this guide, we have looked at two different ways to autocomplete WooCommerce orders: utilizing a plugin and adding PHP code snippets.

Both approaches will complete the task, so just follow the one that best matches your skills.

Thanks a lot for reading, and we’ll see you in the next one.


Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Singapore. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.

Stay in the know

Get special offers on the latest news from AVADA.