I’m trying to display the meta-field “_ts_gtin” of a variable product within the tab “additional_information” of a single product.
I just figured out that I can get the value of a specific variation this way:
get_post_meta( $variations[ 'variation_id' ], '_ts_gtin', true )
Can anyone help me?
2
Answers
You can add this to your functions.php or plugin:
Add the follows code snippet to do the above –
Codes goes to your active theme’s functions.php