Title: PHP Coding example please
Last modified: February 3, 2022

---

# PHP Coding example please

 *  [wattsyourwebsite](https://wordpress.org/support/users/wattsyourwebsite/)
 * (@wattsyourwebsite)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-coding-example-please/)
 * Hi there,
 * I have Product Add-ons for my WooCommerce Product that are 5 text fields (I’m
   using the free version of this plugin). Those 5 text fields are labelled as follows:
   
   Email Address #1 Email Address #2 Email Address #3 Email Address #4 Email Address#
   5
 * When the customer places the Order I want to be able to loop through those 5 
   email address and send a special notification email to that recipient. I know
   how to Hook the event of Order Processing, I just don’t know the PHP I need to
   extract those 5 fields in the Order Item Meta. Any example code would be most
   appreciated.
 * Thanks
    Tania

Viewing 1 replies (of 1 total)

 *  Plugin Support [Giuseppe Madaudo](https://wordpress.org/support/users/askmagic/)
 * (@askmagic)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/php-coding-example-please/#post-15329610)
 * Hi there,
 * the options are saved in the order details like this:
    `wc_add_order_item_meta(
   $ item_id, $ name, $ display_value);` so to read the value you should use: `wc_get_order_item_meta(
   $ item_id, $ name);` where: $ name is the label of the option

Viewing 1 replies (of 1 total)

The topic ‘PHP Coding example please’ is closed to new replies.

 * ![](https://ps.w.org/yith-woocommerce-product-add-ons/assets/icon-128x128.gif?
   rev=3142291)
 * [YITH WooCommerce Product Add-Ons](https://wordpress.org/plugins/yith-woocommerce-product-add-ons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yith-woocommerce-product-add-ons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yith-woocommerce-product-add-ons/)
 * [Active Topics](https://wordpress.org/support/plugin/yith-woocommerce-product-add-ons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yith-woocommerce-product-add-ons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yith-woocommerce-product-add-ons/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Giuseppe Madaudo](https://wordpress.org/support/users/askmagic/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/php-coding-example-please/#post-15329610)
 * Status: not resolved