Stamp Sequential Order Number on PDF

It is frustrating to some WooCommerce shop keepers that automatically generated order numbers occasionally skip numbers or blocks of numbers. There are ways to prevent this, and now there is a way to stamp your sequential order number (not just the generated one) on your customers’ PDF files, too!

Wait! Aren’t Order Numbers Automatically Sequential?

Short answer: No. WooCommerce order numbers are not automatically sequential.

In a basic WooCommerce installation, you might notice how you’ll get order numbers 300, 301, 302, then… 305? Why did it skip 303 and 304?

Order numbers are “skipped” because those numbers are used for WordPress blog posts, pages, and for other WP post types as they are published. As long as there is no activity on your site between orders, you might see sequential numbers, but this is unlikely since you might be running other plugins which write to the database, offering order refunds, uploading media, or writing blog posts. Those activities will consume “skipped” numbers, like 303 and 304.

If you check out your WordPress database wp_posts (or your custom prefix + _posts) table, you can see this in action for the shop_order post type. Posts of that type will be interspersed with posts of other types, each getting a sequential ID number in the order of occurrence.

How Can We Get Sequential Order Numbering?

If you search/Google the term “woocommerce sequential order numbers,” you will see that several plugins exist for this purpose. You can choose which one to use, but they all essentially work the same: the plugins generate a *proxy* order number for display, while hidden in the background (in the database) the true order IDs are still skipping numbers. In other words, the plugin will map actual order numbers to the display order numbers for you.

Sequential order numbering is more than just a cosmetic change for an WooCommerce shop – it can be a critical aspect of professional e-commerce management. Skipping numbers might look unprofessional to 3rd parties and make order tracking and accounting challenging.

By implementing sequential order numbering, you:

  • Improve order tracking and identification
  • Create a more professional invoicing system
  • Simplify accounting and record-keeping
  • Perhaps enhance customer trust and perception of your business

Pitfalls of sequential order numbering might include:

  • Increased complexity when migrating to another e-commerce solution later
  • Creating a dependency on a third-party plugin for any functionality increases your site’s vulnerability to potential plugin conflicts or discontinuation. We always use fewer than 20 plugins in every website we build or repair. Some are an absolute must – like PDF Ink! 😉
  • Plugins might add extra database queries and processing overhead, potentially slowing down order processing and checkout experiences. This overhead is expected to be very slight with a sequential order numbering plugin.

OK, anyway, you have sequential order numbering. And even if you don’t have sequential numbers, you have order numbers. So now what?

How to Print an Order Number on a PDF

Use PDF Ink to add text to a PDF or EPUB file just before it is downloaded by your customer. The text can be anything you like, and can include dynamic information such as buyer name, email, address, quantity purchased, and… order number. Each PDF will be uniquely stamped, according to who is downloading it, and when.

To add the order number to a PDF watermark using PDF Ink, we’d just use the [ORDERNUMBER] magic tag in our placement content. There is no need to write any code to make the magic happen. PDF Ink will turn [ORDERNUMBER] into the correct customer order number, whether it is a sequential order number or not.

💫 Simple as that – Download PDF Ink today!

Note: The [ORDERNUMBER] magic tag doesn’t just work for WooCommerce, it will also work for Easy Digital Download and Download Monitor PDF file downloads, too.

How Else Can We Customize Customers’ PDFs?

If you are using WooCommerce and selling PDF or EPUB files, here are other items you can print on the file just before it is delivered to a customer:

  • First name => [FIRSTNAME]
  • Last name => [LASTNAME]
  • Email => [EMAIL]
  • Phone number => [PHONE]
  • Business name => [BUSINESSNAME]
  • Timestamp => [TIMESTAMP]
  • Unix timestamp => [UNIXTIMESTAMP]
  • Date => [DATE]
  • Order ID (the non-sequential order number) => [ORDERID]
  • Product name => [PRODUCTNAME]
  • Product quantity => [PRODUCT-QTY]
  • Address Line 1 => [ADDRESS1]
  • Address Line 2 => [ADDRESS2]
  • City => [CITY]
  • State => [STATE]
  • Postcode => [POSTCODE]
  • Country => [COUNTRY]
  • Country Code => [COUNTRYCODE]

We call these pink, bracketed lovelies “magic tags,” because they’re magical! Your customers receive customized PDF files thanks to magic tags!

PDF Ink has way more built in tags like this than any other watermarking plugin for WordPress, including even WooCommerce PDF Watermark and Woocommerce PDF Stamper.

Not only does PDF Ink already have more, but it is straightforward how to add your own “magic tags” using PDF Ink filter hooks. Here is an example of how a sheet music vendor added a magic tag for choir ensemble name and another example of how Brazilian shops can add a custom CPF magic tag.

To top