wordpress - Woocommerce getting custom field values in cart and checkout -


i trying custom field value of woocommerce product display on different pages of shop system. succeeded single product page, same code doesn't work cart.

for single product used code within functions.php, works fine:

global $post; echo '<p>' . get_post_meta($post->id, 'my-custom-field', true) . '</p>'; 

i tried same code cart, time values don't show on page. referred thread (woocommerce getting custom attributes), changing $post $product, still no output...

any suggestions?

<?php echo get_post_meta( get_the_id(), 'slug/id', true ); ?> 

you can try this, works me well.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -