How to access _unit_product post meta?
-
Hi,
I’m trying to read the unit_product metadata from a localized product.
This works for the base (english) product:
get_post_meta( $_product->get_id(), '_unit_product', true);
but the unit metadatas are not available when the product ID is the one of the localized product. Is there an easy way to access this or should I get the orignial ID and call get_post_meta with the original product only?
More info:
the var_dump of the localized simple product shows that the meta keys for “unit” are available but somewhere hidden inside this:["gzd_product"]=> object(WC_GZD_Product)#11978 (3) { ["child":protected]=> *RECURSION* ["gzd_variation_level_meta":protected]=> array(7) { ["unit_price"]=> string(0)
Any help is appreciated!
Regards,
thesun1
- The topic ‘How to access _unit_product post meta?’ is closed to new replies.