Get Post Meta – for Composite or Bundled Product
-
I’m using Composite Products for Woocommerce (similar to Bundled Products). I’m trying to get a custom meta field from both the parent and the child of (each) item in the Order, final checkout stage.
Usually I would simply do (for each):
get_post_meta( $product_id, ‘my_custom_meta_here’, true );
Which would return my custom meta field ‘my_custom_meta_here’. I realise this is now complicated due to Composite Products, I somehow need to run get_post_meta for the Parent component and the Child, each have their own individual custom_meta I require to process the order.
But, I find the language very tricky. Here’s the documentation; https://docs.woocommerce.com/document/composite-products/composite-products-functions-reference/#get_product_from_item
For simplicity sake, each Composite Product is made up of just one Parent and one Child.
Thank so much for any guidance.
- The topic ‘Get Post Meta – for Composite or Bundled Product’ is closed to new replies.