Adding new meta data to orders
-
So I’ve been trying to add new meta data to an order, that will be updated when the order gets changed to two custom status.
Now I’ve tried adding the new meta data using this code in child themes function.php file:
add_action('woocommerce_checkout_update_order_meta', 'add_bill_date_meta_data', 10, 2); function add_bill_date_meta_data($order_id, $data) { update_post_meta($order_id, 'bill_date', NULL); }
Shouldn’t this be enough to add a new meta data with content of it being NULL. Now I might be doing something really dumb here, but when the order gets created, or updated or anything, I don’t see this meta data in the webhook content, REST API or in the database.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding new meta data to orders’ is closed to new replies.