How can I add a metafield on a collection page?

How can I add a metafield on a collection page?

clavilla57
Explorer
92 0 16

Hi, i'm trying to add a metafield to the collection page between the title and the price of the product, that doesn't display anything when blankuntitled.png

 

This is the metafield name

custom.intensit_

 

www.danicoffeeshop.com

Replies 2 (2)

BSS-Commerce
Shopify Partner
3477 463 539

Hi @clavilla57 ,

In order to do that, firstly you need to access to the theme file.
- Go to Online Store and access Themes.
- Find the theme you are using and click on "Actions"  and then  "Edit Code."

- In left hand sidebar, find the file name product.liquid or product-card.liquid
- Open the file in code editor, find the place you want to add your custom metafield and paste the script:

{% if product.metafields.custom.intensit_ != blank %}
  <p>{{ product.metafields.custom.intensit_ }}</p>
{% endif %}

Hope it works @clavilla57 

If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here .


B2B Solution & Custom Pricing | Product Labels by BSS


Need help from our expert? Kindly share your request with us via community@bsscommerce.com


BSS Commerce - Full-service eCommerce Agency
stefanensko
Explorer
47 0 7

I'm clavilla with the second account, i'm trying to add it over the price, but i'm not able to find where to paste it..i know i'm noob