Add extra meta for orders in Woocommerce
The 2018 way: Built on Guido W.P. answer you can use instead woocommerce_checkout_create_order action hook in a more lighter and effective version code (using WC 3+ CRUD methods): add_action(‘woocommerce_checkout_create_order’, ‘before_checkout_create_order’, 20, 2); function before_checkout_create_order( $order, $data ) { $order->update_meta_data( ‘_custom_meta_key’, ‘value’ ); } Code goes in function.php file of your active child theme (or active … Read more