Title: Get metadata
Last modified: June 26, 2023

---

# Get metadata

 *  Resolved [pattice](https://wordpress.org/support/users/pattice/)
 * (@pattice)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/get-metadata/)
 * Hello,
   How can I get fields data from each field or metadata from the information
   provided by the customer?

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

 *  [brozra](https://wordpress.org/support/users/brozra/)
 * (@brozra)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/get-metadata/#post-16849147)
 * I don’t know if there is a shortcode that will get you all the PPOM data stored
   with a particular product in one convenient call. I haven’t checked the source
   code but I doubt it exists.
 * You can, however, get the data from the WooCommerce cart array by looping through
   the WC cart array like so:
 *     ```wp-block-code
       foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) {
       $ppom_data = $cart_item["ppom"]["fields"];
       var_dump($ppom_data);
       }
       ```
   
 * The code above will give you a visual reference to the data stored when a customer
   uses the PPOM plugin fields on a product. So if you have a PPOM option called**“
   size”** then you should be able to reference it by using `$cart_item["ppom"]["
   fields"]["**size**"]`. If the data you want to reference has a space in the PPOM
   field name, then replace the spaces with underscores. Use the data name that 
   PPOM generates when you save a field.
 * This is just an example of how to reference and find how the data is stored in
   the cart. This code shouldn’t be used **anywhere** on a production website open
   to the public.
 *  [luciamarinescu](https://wordpress.org/support/users/luciamarinescu/)
 * (@luciamarinescu)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/get-metadata/#post-16871743)
 * Hi [@pattice](https://wordpress.org/support/users/pattice/)!
 * Unfortunately, there is no way to achieve this using the plugin options. However,
   it may be possible to do it using custom code.
 * Thanks for understanding and have a nice day!

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

The topic ‘Get metadata’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-product-addon/assets/icon-256x256.gif?rev=3186763)
 * [PPOM - Product Addons & Custom Fields for WooCommerce](https://wordpress.org/plugins/woocommerce-product-addon/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-product-addon/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-product-addon/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-product-addon/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-product-addon/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-product-addon/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [luciamarinescu](https://wordpress.org/support/users/luciamarinescu/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/get-metadata/#post-16871743)
 * Status: resolved