I’m working in WordPress 4.3.1., with WooCommerce 2.4.7. For my employer’s current store project, we need to have unique IDs generated for each item purchased, which can never be the same as any other purchase.
For example, if someone buys 3 shirts of the same design and size, each of these shirts, once in the cart, should each have a unique item ID displayed. Regardless of the number of orders we get, the unique item IDs cannot be duplicated.
As for the ID, I was considering mixing the product SKU with the date, and possibly the order ID to generate the date. How exactly would I go about this? Is there a plugin that can handle this, or should I deal in straight PHP?
I assume you want to use the unique id for work order tracking internally
use this hook (I am using processing rather then completed)
Then do this
You could use a WooCommerce hook like woocommerce_order_status_completed in order to run something after every purchase.
I can suggest you to use a post meta or an user meta (based on your needs).