This week we’ll take a look at WooCommerce orders and a neat WooCommerce core function called wc_get_customer_last_order
.
Nothing mysterious here β pass a customer ID, and with a PHP one-liner, you get immediately the customer’s latest order!
This can be used in several scenarios. Think for example of an email campaign that triggers six months after the customer’s last order to entice them to reorder. (In marketing, you’d call it a “Win-Back” campaign.)
But before looking at some case studies, let’s analyze the function syntax and source code.