{% for block in section.blocks %}
{% for image in product.images %} {{ image.src | product_img_url: 'grande' }} {% endfor %}
{{block.settings.product.title}}
{{all_products[product].price | money_without_trailing_zeros }}
{% endfor %}
{% schema %}
{
"name": "Demo",
"blocks": [
{
"type": "new-arrival",
"name": "New Arrival",
"settings": [
{
"type": "product",
"id": "product",
"label": "Product"
}
]
}
]
}
{% endschema %}
Can anyone tell me how can I call multiple product images, product details, and product prices on the section page?
Here some code that I try but it’s not correct.
2
Answers
Thank You for guide Onkar. I update a little bit now it properly works.
when using the input type
product
into Shopify schema, you need to use theall_products
object to get the details of the selected product, you need to get the details and assign it to a variable, something like this one.Then you can use the other properties of the same object. so your code is looking.
You can check and read more about object
all_products
Link