Title: Adding a custom shipping field
Last modified: August 22, 2016

---

# Adding a custom shipping field

 *  [Stefan Velev](https://wordpress.org/support/users/kozzmen/)
 * (@kozzmen)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/adding-a-custom-shipping-field/)
 * Hello **Woo team**,
 * I am following this tutorial: [Lesson 2 – Adding custom shipping and billing fields](http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/#section-3)
   and thanks to it, I was able to add shipping phone to my checkout page (When “
   Ship to a different address” is selected).
 * The problem is that this new field is missing in the Order details – I have there
   just the Shipping address and Customer notes, but the this new phone is missing:
   [http://prntscr.com/6lx1n3](http://prntscr.com/6lx1n3)
 * How do I add this field there? (I also need to include it in a PDF invoice plugin)
 * Thanks!
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

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

 *  [kingturban](https://wordpress.org/support/users/kingturban/)
 * (@kingturban)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/adding-a-custom-shipping-field/#post-5947908)
 * You need to save the information in order metadata to be able to see it.
 * Something like that
 *     ```
       add_action( 'woocommerce_checkout_update_order_meta', 'my_write_to_meta_function' );
   
       function my_write_to_meta_function( $order_id ) {
       update_post_meta($order_id, "order_meta_field", sanitize_text_field($_POST["my_field_name"]));
       }
       ```
   
 *  Thread Starter [Stefan Velev](https://wordpress.org/support/users/kozzmen/)
 * (@kozzmen)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/adding-a-custom-shipping-field/#post-5947975)
 * I am confused because of this paragraph just under the picture in the tutorial
 * > Now we have this new field, what do we do with it? We don’t need to do anything!
   > Because we’re defined the field in the checkout_fields array the field will
   > be automatically processed and saved to the order post meta (in this case the
   > field will be _shipping_phone). If you want to add extra validation rules see
   > the checkout class; there are additional hooks in there you can use.
 * Anyway, thanks for the snippet **kingturban**, I will give it a try.
 * P.S. What should I use instead of “my_write_to_meta_function”?
 * Thanks!

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

The topic ‘Adding a custom shipping field’ 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/)

## Tags

 * [shipping phone](https://wordpress.org/support/topic-tag/shipping-phone/)

 * 2 replies
 * 2 participants
 * Last reply from: [Stefan Velev](https://wordpress.org/support/users/kozzmen/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/adding-a-custom-shipping-field/#post-5947975)
 * Status: not resolved