metaobjects multiple entry PDP page

metaobjects multiple entry PDP page

Aliecommerce
Shopify Partner
13 0 3

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?

Replies 3 (3)

Aliecommerce
Shopify Partner
13 0 3

{% 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>

 

Aliecommerce_0-1723457638282.png

Aliecommerce_1-1723457657157.png

 

Small_Task_Help
Shopify Partner
782 25 69

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 %}
To Get Shopify Experts Help, E-mail - hi@ecommercesmalltask.com
About Us - We are Shopify Expert Agency
At Google My Business - Ecommerce Small Task - Hire Shopify Developers Ahmedabad
Aliecommerce
Shopify Partner
13 0 3

 

{% 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

["test1","test2","test3"]

and image showing blank