Hello!
How exactly would one go about putting words underneath the product image and above the price/buy button inside a collection page, on a featured product header in the main site, etc?
I’ve seen this page but the advice given is unclear and doesn’t seem to work according to the poster.
There’s likely a snippet that gets output for every product in your collection loop. It’s going to be different for every theme. Typically there’s a loop outputting your collection items like:
{% for product in collection.products %}
{% render 'product-card', product: product %}
{% endfor
In this case “product-card” would be a snippet called “product-card.liquid”
Inside there you’d find the code for the card, and then in that case you’d find where your image is being output and put your text there. If it was the same text for every product it would be as simple as adding the text to the card. However if you want it product based (different for every one) you would need to make a product metafield (Settings > Custom data > Products ) for your product with a type of “Single line text”.
Then you’d go into your product in the admin, towards the bottom you would see where you could edit your metafield after you created it. I didn’t actually make that metafield that I posted above, but it would appear here:
After you edited the metafield and added your text for the product you’d go into the product-card snippet and add it by checking if it existed. A simplified example:
From your Admin Page, click Products, choose one of the products. When you scroll down, you should see the section for the short_description metafield,
It wouldnt be ONE description for all of the products, no. It would be different for each product, and available to read under a product image and above the price tag as a unique description or message. Is this what your solution does?
this code actually calls your custom metafield to be displayed on the website
save the change.
please note that different themes might have different code on the card-product.liquid file. i haven’t tried any other template, just take into consideration. most probably you will need to locate the:“
” where actually a product card starts, after product title and the price.
3. add the short description to a product meta field
Is there any way of retrieving automatically the first line of the actual description already written on published products and use it on the metafield? My store has almost 1000 products and I think it wouldn’t be possible to do it manually one by one. Thanks