Metafield not visible on single product page

Hi on my theme metafield is not visible on frontend

https://8b047a-60.myshopify.com/

gaisao

Is anybody help me?

Hi,

The metafield data field can be used in the theme customizer, if it doesn’t nest metaobject.

You can click “dynamic data source” to use a metafield value.

Yeah I need dynamic metafield its all visible on backend even I’m adding values to every product but on product page its not showing

1 Like

On the screenshot above, you are searching metafiels in the blocks. It’s wrong.

You should search your metafieds after you will click on the “dynamic source” button, INSIDE a section or block

Read thought the guide for detailed how to https://shopify.dev/docs/themes/architecture/settings/dynamic-sources#example

Hi Serj94

Thanks for your reply I just checked articles but I dont have rich text or dynamic option

I’m adding metafield on my product page here is the code

Test {{ product.metafields.test }}
Occasion {{ product.metafields.next_cart.occasion }}

But the proble is its not showing the category in front of test I have assign from backend.

Screen shot attached

2 Likes

To access a custom metafield name, you should use: product.metafields.custom.test

Similar issue: https://community.shopify.com/c/metafields-and-custom-data/displaying-and-calculating-metafields-in-liquid/m-p/2226301/highlight/true#M1859

1 Like

Hi Serj94
After adding product.metafields.custom.test I’m getting this instead of collection

I want to add collection with link infront of test

Try also to add .value in the end to get a value from a metaobject.

To extract values from an array, such as your [“ssss”], use liquid for loop

Geeting

CollectionDrop

after adding {{ product.metafields.custom.test.value }}

CollectionDrop, because there should be more properties on the metafield.

For example: product.metafields.custom.test.value.collection_text.value

Added this product.metafields.custom.test.value.collection_text.value getting nothing

.collection_text. was as example :slightly_smiling_face:

To see your real metafield properties, go to the admin, settings, custom data, select you metafield.

This custom.test is already added

1 Like

Return to the liquid code product.metafields.custom.test

Add .value.url

Example:

{% assign mycollection = product.metafields[“details”][“mycollectionfield”].value %}

{% comment %}

{{ mycollection.title }} - returns collection title

{{ mycollection.url }} - returns collection URL

{% endcomment %}

1 Like

Thank you soo much
I used this

Test {% assign test_metafield = product.metafields.custom.test.value %} {% if test_metafield and test_metafield.title and test_metafield.url %} {{ test_metafield.title }} {% else %} N/A {% endif %}
Occasion {{ product.metafields.next_cart.occasion | default: "N/A" }}
its working thanks
1 Like