Linking metafield to specific products

Solved

Linking metafield to specific products

Element4
Tourist
6 0 1

My webpage has multiple product collections - each of the collections have different product specifications and care instructions. 

 

I added a collapsible block on my product page. However, when I enter data in one of the tabs, it changes for all products. I tried creating a metafield for the same and tried linking it to specific products, however, the text/data does not show in the selected block/tab. 

 

How can I link the row contents to a dynamic source metafield that I have created and make sure that it is displayed on th eproduct page?

Accepted Solution (1)

devmont-digital
Shopify Partner
132 31 34

This is an accepted solution.

Hello @Element4,

 

If you want to show dynamic data in a collapsible block on the product page, follow these steps:

  • Go to Dashboard -> Settings -> Custom Data -> Products -> Add definition, and write the name (e.g., Dynamic Information). Select the type 'single line text,' choose one value, and save it.

1.png

 

  • Navigate to Online Store -> Themes -> Edit Code. Search for the file main-product.liquid, find collapsible_tab, and paste the provided code. I have attached a screenshot showing where to place the code.

2.png

 

  • Now go to Dashboard -> Products, select the products where you want to show the dynamic data, scroll down to the products, and you will see the product metafields. In the 'Dynamic Information' field, write any information you want, and this text will be shown in the collapsible tab on the product page.

3.png

Found our answer helpful? If so, Don't forget to show your support by liking and accepting the solution.
Looking for more help and expert consultation? Feel free to contact us at Shopify Expert or visit our website www.devmontdigital.io
Hire us for your project by simply emailing us at sales@devmontdigital.io

View solution in original post

Reply 1 (1)

devmont-digital
Shopify Partner
132 31 34

This is an accepted solution.

Hello @Element4,

 

If you want to show dynamic data in a collapsible block on the product page, follow these steps:

  • Go to Dashboard -> Settings -> Custom Data -> Products -> Add definition, and write the name (e.g., Dynamic Information). Select the type 'single line text,' choose one value, and save it.

1.png

 

  • Navigate to Online Store -> Themes -> Edit Code. Search for the file main-product.liquid, find collapsible_tab, and paste the provided code. I have attached a screenshot showing where to place the code.

2.png

 

  • Now go to Dashboard -> Products, select the products where you want to show the dynamic data, scroll down to the products, and you will see the product metafields. In the 'Dynamic Information' field, write any information you want, and this text will be shown in the collapsible tab on the product page.

3.png

Found our answer helpful? If so, Don't forget to show your support by liking and accepting the solution.
Looking for more help and expert consultation? Feel free to contact us at Shopify Expert or visit our website www.devmontdigital.io
Hire us for your project by simply emailing us at sales@devmontdigital.io