I created a product metafield to display on the default collection product grid, underneath each product. The metafield is product.metafields.custom.fragrance. It is a single line, list of values. The metafield displays where it should on the product grid, but all values for the metafield are surrounded by square brackets and double quotes “”.
Like this, exactly as typed: [“Cypress Saffron Wood”]
In above example the words Cypress Saffron Wood is a single value within the metafield list of values - the list of values are entered without brackets or quotes.
I added the metafield to card-product.liquid by doing this, at line 159 (just below the show_vendor endif)
Thank you. I tried both your suggestions, the metafield will not show any output with either option. To test a little more along the array theory, I changed the metafield list of values to be just one word, not a string of individual words. Unfortunately, same output such as:
Product 1 card_product.metafields.custom.fragrance value = [“blue”]
Product 2 card_product.metafields.custom.fragrance value = [“green”]
The values are correct with the right metafield value showing up under the right product. Just need to get rid of the brackets and quotes.
Joeybab3, I got it - thanks to your input. Your comments about array made me wonder why your suggestions did not work, so explored some more. I had created the metafield using the editor. As I was needing a list of values, I chose “List of Values” for the data definition. That was the mistake - I should have chosen “One Value” and just entered the values I required using ‘add item’. Everything works fine now - no brackets or quotations!