Archived topic
Get data from post meta
1 reply · Started by Andrew on March 18, 2021
I use ProductFeed elite. It has an MPN value stored in post_meta > _woosea_mpn. I want to show that with the current meta block on the product pages. I'm not very good with this stuff. I've tried a few things but can't get it to work.
So far I have this in a hook element at woocommerce_product_meta_start:
<?php get_post_meta($product->get_id,'_woosea_mpn',true);
echo "MPN: " . $product ;
?>
It doesn't echo the $product. Are you able to tell me what more I need to do or change to get this to show up please?
Once this is working I'd also like to have it show on any product block, archive etc above the button. I suspect I would need to use woocommerce_before_add_to_cart_button or woocommerce_before_add_to_cart_form but I would prefer if you could also clarify that for me please.
Thank you.
Hi Andrew,
Unfortunately this is something you will need to check with WooCommerce' support team as it's not a theme-related question:
https://generatepress.com/what-support-includes/
Hopefully they will be able to point you in the right direction.
Thanks for your understanding :)