Re: Show Product Metafield on Collection Page or Home Page

Show Product Metafield on Collection Page or Home Page

itsPhil1
Visitor
3 0 0

I want to display a product metafield on a collection page or home page. Here is an example:Bildschirmfoto 2024-09-14 um 14.20.16.JPG

 

And I want to display the metafield under the Product Price.

I've already tried it with "product.metafields.custom.nameofmetafield.value" but it isn't showing on the collection page.

Reply 1 (1)

PaulNewton
Shopify Partner
7450 657 1564

HI @itsPhil1 👋 it should be: 

{{ product.metafields.custom.nameofmetafield.value }}

Along with the curly brackets the key nameofmetafield needs to be the actual key of the metafield you created and not a generic placholder used for examples sake.

 

This is IF the metafield is on the product itself, and the "product" is the context of the variable in the collection template or product grid.

meaning it could be current_product or card_product , etc etc instead of just product but you need to read the theme code to be sure

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org