Title: Is it possible use function get?
Last modified: August 21, 2016

---

# Is it possible use function get?

 *  Resolved [Lenykeksik](https://wordpress.org/support/users/lenykeksik/)
 * (@lenykeksik)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/is-it-possible-use-function-get/)
 * Hello, First of all, you made a great job! I would like to ask, how could I get
   data from billing and shipping section. Is it stored in WC_Order, so could I 
   just`$example = $order->get_example_field;
    ` Please forgive if, if it’s stupid
   question, but I’ve just started with PHP and I couldn’t this figured out. Thank
   you 🙂
 * [http://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/](http://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [ulihake](https://wordpress.org/support/users/ulih/)
 * (@ulih)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/is-it-possible-use-function-get/#post-4547036)
 * Hello Lenykeksik.
 * Thanks for your feedback.
 * All data is stored in the database of your WordPress instance as a meta value
   associated with the post of type shop_order.
 * This means you can use the wordpress function get_post_meta to retrieve the data
   of all fields configured for your checkout forms, internal and custom fields 
   if you don’t have a valid WC_ORDER object available. In this case you will need
   the Order ID and you could retrieve the values stored with
 * `$email = get_post_meta([order_id], '_billing_email', true);`
 * If you have access to a valid Order object constructed by the class WC_ORDER 
   you can use the field name of a default WooCommerce field like _billing_email
   to retrieve the value.
 * `$value = $order->billing_email;`
 * For custom fields you can use the field name as indicated in the settings of 
   WooCommerce Poor Guys Swiss Knife in the Billing or Shipping Section
 * `$value = $order->billing_your_sanitized_custom_field_name;`
 * or
 * `$value = $order->shipping_your_sanitized_custom_field_name;`
 * Don’t forget to assure yourself that you have constructed the $order object with
   an order id otherwise you have to assure to load a valid order first.
 * Hope this answer helps you with your code.
 * Regards.
    uh

Viewing 1 replies (of 1 total)

The topic ‘Is it possible use function get?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/woocommerce-poor-guys-swiss-knife_ffffff.
   svg)
 * [WooCommerce Poor Guys Swiss Knife](https://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-poor-guys-swiss-knife/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [ulihake](https://wordpress.org/support/users/ulih/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/is-it-possible-use-function-get/#post-4547036)
 * Status: resolved