All things Shopify and commerce
Display multiple entry using metaobjects and meta field Shopify product page
need to display image and title block in product page using metaobjects how can do it?
{% assign test = product.metafields.custom.test.value | json_parse %}
<div class="ingredients-section">
<h2>{{ test.section_title }}</h2>
<p>{{ test.section_subtitle }}</p>
<div class="ingredients-slider">
{% for i in (0..test.ingredients_image.size) %}
{% assign image_url = test.ingredients_image[i] | img_url: 'master' %}
<div class="swiper-slide ingredients__item">
<img
src="{{ image_url }}"
alt="{{ test.ingredients_title[i] }}"
class="ingredients__image"
>
<p class="ingredients__name">{{ test.ingredients_title[i] }}</p>
</div>
{% endfor %}
</div>
</div>
Hi,
Need to use Metaobjects product template
Code example to display Metaobjects
{% if product.metafields.custom.metaobject_field %}
{% for entry in product.metafields.custom.metaobject_field.value %}
<div class="metaobject-entry">
<img src="{{ entry.image | img_url: 'large' }}" alt="{{ entry.title }}">
<h3>{{ entry.title }}</h3>
{% if entry.description %}
<p>{{ entry.description }}</p>
{% endif %}
</div>
{% endfor %}
{% endif %}
{% if product.metafields.custom.test %}
{% for entry in product.metafields.custom.test.value %}
<div class="metaobject-entry">
<img src="{{ entry.ingredients_image | img_url: 'large' }}" alt="{{ entry.title }}">
<h3>{{ entry.ingredients_title }}</h3>
</div>
{% endfor %}
{% endif %}
Showing array in title
and image showing blank
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025