Is this attribute already included in your product template’s liquid file?
I assume that you have defined this attribute in the product’s setting?
If yes to the above questions, would you mind sharing screenshots of the placement of the variable in your code, and of it defined in the product’s metafield?
Where exactly, what line, does this code go? Need specifics please.
I should clarify for anyone reading this that the rich metafield on the product page is going to be DIFFERENT on every product page, so just adding a block is not going to work.
I need to add the code to my product template page - but don’t know where to add it. Want it full width directly in between the product description/image section and the reviews section. Every time I place the code somewhere it’s the wrong place.
The attribute is via a metafield app, defined as a rich text field.
Don’t have the code placed yet - need to know where it should go.
@claribelskincar Thanks for your replies! If you are using a metafield app, you need to make sure that it’s storing the metafields in Shopify’s native metafields system. Usually you can access the metafields within a product. It’s stored under the “Product metafields” section, which only shows if metafields were added to Shopify’s native metafields system as mentioned:
To display your metafield, you can access it by adding {{ product.metafields.custom.rich_text_field.value }} into your preferred template. Let’s say that you wanted to add it above your Add to Cart button, then you would need to find either your product template, which could be “sections/main-product.liquid” or the cart form’s template which could be “snippets/buy-button.liquid” or “snippets/product-form.liquid”. So, the 1st part is identifying which template renders your product page or the cart/product form.
Then find the code in the template that’s associated with the area where you want to add the rich text. So, if you wanted to add it before the product form, then you would have to search the template for the div that has the class “product-variant-id”: