Title: Adding custom fields to customer note
Last modified: May 5, 2020

---

# Adding custom fields to customer note

 *  Resolved [nemovich](https://wordpress.org/support/users/nemovich/)
 * (@nemovich)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/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](https://wordpress.org/support/topic/custom-order-note-in-view-order-page/)
   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 tired `false` 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)

 *  [Nicola Mustone](https://wordpress.org/support/users/nicolamustone/)
 * (@nicolamustone)
 * Automattic Happiness Engineer
 * [6 years, 1 month ago](https://wordpress.org/support/topic/adding-custom-fields-to-customer-note/#post-12788765)
 * Hello,
    This is a fairly complex development topic. I’m going to leave it open
   for a bit to see if anyone is able to chime in to help you out.
 * I can also recommend the following places for more development-oriented questions:
    1. WooCommerce Slack Community: [https://woocommerce.com/community-slack/](https://woocommerce.com/community-slack/)
    2. WooCommerce FB group: [https://www.facebook.com/groups/advanced.woocommerce/](https://www.facebook.com/groups/advanced.woocommerce/)
 *  Thread Starter [nemovich](https://wordpress.org/support/users/nemovich/)
 * (@nemovich)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/adding-custom-fields-to-customer-note/#post-12790568)
 * I got help from another samaritan, here’s the code :
 *     ```
       add_action( 'woocommerce_new_order', 'add_engraving_notes' );
   
       function add_engraving_notes( $order_id ) {
   
       //because I already have the ID from the hook I am using.
           $order = wc_get_order( $order_id );
   
       // The text for the note
           $delivery_date   = get_post_meta( $order_id, 'delivery_date', true );
           $time_slot_from  = get_post_meta( $order_id, 'time_slot_from', true );
           $time_slot_to    = get_post_meta( $order_id, 'time_slot_to', true );
   
           $note = "Deliver Date:$delivery_date Time Slot From: $time_slot_from Time Slot To: $time_slot_to";
   
       // Add the note
           $order->add_order_note( $note );
   
       // Save the data
           $order->save();
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding custom fields to customer note’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [nemovich](https://wordpress.org/support/users/nemovich/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/adding-custom-fields-to-customer-note/#post-12790568)
 * Status: resolved