How To: Add Product Meta to Line Items in Orders (Woocommerce 3.0+)

February 21, 2018

From time to time, developers or store owners want to sync across hidden meta values or custom fields from Products to corresponding Line Items in Orders.

There were a few ways to do this before Woocommerce 3.0, and some may still work, but with CRUD functions being the new (and recommended) way forward, we were looking for another way to quickly replace our old ‘order meta syncing’ functions.

This is what we’ve come up with and it’s pretty lightweight (lines extended below for readability) so we figured we’d share it, incase it can save you some development/research time.