Metafield to show on card-product.liquid Dawn 5.0 Theme

I added some custom metafields. One is location. If the value is filled out, I want it to show on the card-product in the correct Collection. Ideally, I would want something like if collection is equal to X then show these metafields.

I found where it appears in the code and placed this in the card-product.liquid The metafield has a value for this test product but doesn’t show. See enclosed images.

Location: {{ product.metafields.custom.location.value }}

The word location shows, but no meta value.

1 Like

hey, Randalma.

The issue is that the product in this file is defined as card_product, you can even see a little bit of that above your line in the code. just replace product with card_product and it should work

1 Like

@randalma

oh sorry for that issue can you try this code

its work


Location: {{ card_product.metafields.custom.location.value }}

4 Likes

Thanks, this worked.

1 Like