Solved

How can I call product image, details, and price in section page?

anupam1607
Shopify Partner
7 1 0

Hey everyone,

Can anyone tell me how can I call multiple product images, product details, and product prices on the section page?

Accepted Solution (1)

anupam1607
Shopify Partner
7 1 0

This is an accepted solution.

when using the input type product into Shopify schema, you need to use the all_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.

{% for block in section.blocks %}
{% assign product = all_products[block.settings.product] %}
{% for image in product.images %}
<img src="{{ image.src | product_img_url: 'grande' }}" >
{{product.title}}
{{ product.price | money_without_trailing_zeros }}
{{product.description}}
{% endfor %}
{% endfor %}

 

 

View solution in original post

Reply 1 (1)

anupam1607
Shopify Partner
7 1 0

This is an accepted solution.

when using the input type product into Shopify schema, you need to use the all_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.

{% for block in section.blocks %}
{% assign product = all_products[block.settings.product] %}
{% for image in product.images %}
<img src="{{ image.src | product_img_url: 'grande' }}" >
{{product.title}}
{{ product.price | money_without_trailing_zeros }}
{{product.description}}
{% endfor %}
{% endfor %}