How to use metafiled/metaobject for Product detail page

I want to show the customer review in detail on product detail page in which one card will show for the Pros of the product and other card will show for the cons of the product but I’m confused how can i do this in which user can get the real data? I’m developing a theme so it is a good practice to show this? Please let me know how can i do this without an app

Hey @amisha-29 ,

Using the metafield and metaobject for the Product detail page is the wise strategy. But while implementing this you need to make sure some key points that could help you to make your metafields works smoothly.

Here is how you can define it.

  1. Go to Shopify Admin.
  2. Go to Settings > Custom Data > Metafileds.
  3. In the metafields section select for Products and then add a metafields.
  4. Name is what you want and then select the type of based on the your requirements [eg, type text for headings and Description].
  5. Now after creating the metafields you have to define this in you code. Like I did in the example below.

{{ product.metafields.custom.custom_name }}

​

This will ensure that you will be able to write any name for the customer name or based on your needs for each product individually.

I hope this could helps.

1 Like