WooCommerce Snippet Beginner 3 min

Five WooCommerce Order Tweaks Store Owners Ask For

Auto-complete digital orders, add a prefix to order numbers, put your own message in order emails, add an "Awaiting shipment" status and charge a handling fee. Five snippets, no plugins.

TutorialBeginner10 minTested on WordPress 7.1Updated November 13, 2026

Most WooCommerce stores end up wanting the same few changes to orders. None of them need a plugin. Each snippet below is self-contained, so add only the ones you need.

Before you start

  • WooCommerceA current version, with a backup
  • A way to add PHP snippetsChild theme, must-use plugin or a snippets plugin
  • A test payment methodSuch as a sandbox gateway or Cash on delivery, to place test orders

1. Auto-complete digital orders

By default, every paid order sits in Processing until someone marks it complete, even when there’s nothing to ship. This completes an order automatically once payment is confirmed, but only when every item in it is virtual or downloadable. Mixed orders with a physical product stay in Processing.

functions.phpPHP
add_action( 'woocommerce_payment_complete', function( $order_id ) {
    $order = wc_get_order( $order_id );
    if ( ! $order ) return;

    $auto_complete = true;

    foreach ( $order->get_items() as $item ) {
        $product = $item->get_product();
        if ( ! $product ) continue;

        if ( ! $product->is_virtual() && ! $product->is_downloadable() ) {
            $auto_complete = false;
            break;
        }
    }

    if ( $auto_complete ) {
        $order->update_status( 'completed', __( 'Order auto-completed: all items are virtual or downloadable.', 'nahnu-snippets' ) );
    }
} );
Tested on WordPress 7.1 · PHP 8.3Checked November 13, 2026

It also adds a note to the order explaining why the status changed, so nobody wonders later who completed it.

Bank transfers and cheques

These gateways don’t confirm payment by themselves, so the order completes only after you mark the payment as received. That’s the safe behaviour.

2. Add a prefix to order numbers

“Order #1234” is easy to confuse with an invoice or a ticket number. A prefix like NP-1234 makes order numbers instantly recognisable in emails, My Account and wp-admin:

Snippet

Add a Prefix to Order Numbers

Show order numbers like "NP-1234" instead of "1234" in emails, My Account and wp-admin.

PHPBeginner
View

Only the displayed number changes. The order ID in the database stays the same, so payment gateways and other plugins keep working.

3. Put your own message in order emails

The emails customers get for processing and completed orders are the ones they actually read. Use them for next steps, a support link or how to access a download:

Snippet

Add Custom Text to WooCommerce Emails

Add a message, such as next steps or a support link, to the emails customers get for processing and completed orders.

PHPBeginner
View
Tip

Say what happens next and when. “Your order ships within 2 working days” saves you more support emails than a thank-you note does.

4. Add an “Awaiting shipment” status

Processing covers everything from “just paid” to “packed and waiting for the courier”. A status in between makes the orders list show at a glance what still needs work:

Snippet

Add a Custom Order Status

Add an order status such as "Awaiting shipment" to track orders between processing and completed.

PHPIntermediate
View

5. Charge a handling fee

For small orders, packaging and payment fees can eat the margin. Add a fixed fee or a percentage of the cart to every order. It works with both the classic checkout and the block-based checkout:

Snippet

Add a Handling Fee to Every Order

Add a fixed handling fee, or a percentage of the cart, to every order. Works in the classic and block-based checkout.

PHPBeginner
View

Show the fee before checkout, on product pages or in the cart, so customers aren’t surprised by it.

You should now see

Place a test order with a downloadable product: it goes straight to Completed, the order number has your prefix, the email shows your message and the totals include the fee. A test order with a physical product stays in Processing, and you can move it to Awaiting shipment.

Summary

Auto-complete digital orders first, since that saves the most time on stores that sell downloads or licences. Then add a prefix, your own email message, an “Awaiting shipment” status and, if you need it, a handling fee. Place a test order after each change.

Was this helpful?

Written by Nahnu Plugins

We build and maintain WordPress plugins. Every guide is tested on a fresh WordPress site before it goes out, and checked again when WordPress updates.

More guides

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only