A space to discuss online store customization, theme development, and Liquid templating.
I've already custom metafield on the product and set it up as a product_reference,
so when I use <p>{{ product.metafields.my_fields.new_product}}</p>, it return string
gid://shopify/Product/7223085072540
as follow the document,https://shopify.dev/api/liquid/objects/metafield
{{ product.metafields.my_fields.new_product.value}} should return product object, but its not, it return noting
Can any body help about this issue ? 😢
I've been trying to diagnose the same issue for a couple hours now.
{{ product.metafields.my_fields.product.value }}
{% assign related_product = product.metafields.my_fields.product.value %}
{% if related_product != blank %}
<a href = "{{shop.url | append: "/products/" | append: related_product.handle }}">
<div class = "related-product">
<div class = "related-product-image" style="background-image:url('{{related_product.featured_image |img_url}}')"> </div>
<div class = "related-product-name">{{related_product.title}}</div>
<div class = "related-product-price">{{related_product.price | money}}</div>
</div>
</a>
{% endif %}