Plugin Contributor
kluver
(@kluver)
hi @steveauchettl,
Within the item loop you can add the following code to retrieve specific item post meta:
<?php $item_meta = wc_get_order_item_meta( $item['item_id'], 'item_meta_key', true ); ?>
Just replace the item_meta_key with the meta key of choice.
I hope this answers your question.
Have a great day!
Michael
Hi Michael
Very helpful thank you – i’ve nearly got it working… once you call the item, then when you then go to show it on the page would you be using something like this? <?php echo $item_meta['item_meta_key']; ?>
Cheers again! Much appreciated 🙂
Plugin Contributor
Ewout
(@pomegranate)
Hi Steve, with michaels example, the meta data is already in $item_meta. You can also echo it out directly (assuming it’s a string):
<?php echo wc_get_order_item_meta( $item['item_id'], 'item_meta_key', true ); ?>
Ewout