how to display a meta field on product detail page in shopify?

php, shopify

Solution

{% for variant in product.variants %}
  // to display the variant metafields use {{resource.metafields.namespace.key}}
  {{ variant.metafields.ShippingWeight.shipping_weight }}
{% endfor %}

SOURCE : How to Display a Metafield in Shopify

Problem

i have a created meta filed using the shopify API call like this: ``` 'POST', '/admin/products/1328/metafields.json', array("metafield" => array('namespace'=>'inventory', 'key'=>'warehouse', 'value'=>"some text here", 'value_type'=>'string'))); ``` But now I want to show this on product detail page how can I achieve this? Or where it will be displayed on the product detail page in Shopify. Can anyone (who has a eCommerce shop on any other system but not on shopify) can see these meta fields?

Original source