Adding custom fields to customer note
-
Hello,
I’m trying to add some custom fields values to customer note, I came across a bit of code here and it works nicely but only for the first custom field
delivery_date
, I need to retrieve the values of multiple custom fields and put the in one customer note. I tiredfalse
at the end but it does not work.add_action( 'woocommerce_new_order', 'add_engraving_notes' ); function add_engraving_notes( $order_id ) { //note this line is different //because I already have the ID from the hook I am using. $order = wc_get_order( $order_id ); // The text for the note $note = get_post_meta( $order_id, 'delivery_date', 'time_slot_from', 'time_slot_to', true ); // Add the note $order->add_order_note( $note ); // Save the data $order->save(); }
any help is welcome, thank you
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Adding custom fields to customer note’ is closed to new replies.