Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Product versions from the metafields field

Product versions from the metafields field

medpak
Excursionist
15 0 3

 

I have different versions of products that I would like to display on the product card. I created a proper field in the metafields section, but I am unable to implement it.

I have a code ready, but it does not work as I would like it because nothing is displayed, neither the image, nor the name of the product, nor the price.

 

How should I change the code to make it work?

 

 

<ul class="recommended-products">
  {% if product.metafields.my_fields.product_version != blank %}
    {% assign product_version =  product.metafields.my_fields.product_version %}
    <li>
      <a href="{{ product_version.url }}" target="_blank">
        <img src="{{ product.metafields.my_fields.product_version.featured_image | img_url: '100x' }}">
        <div>
          <p>{{ product_version.title }}</p>
          <p class="uaf__price">{{product_version.price | money }}</p>
        </div>
       </a>
      </li>
  {% endif %}
</ul>

 

Replies 0 (0)