# first : {{ product.collection[0]}}
hello Every one i want to show the first and third collection from that product on collection page.
i try but not able to access collection without for loop. i want to do without for loop.
# first : {{ product.collection[0]}}
hello Every one i want to show the first and third collection from that product on collection page.
i try but not able to access collection without for loop. i want to do without for loop.
Hii
can you share a screenshot or website link or any other details? Do you want to show only two collections on the collection page? Can you explain further?
hey, 1080, try replacing product.collection[0] with product.collections[0].title
@Uhrick Thanks for the answer. it was working fine.
now i want to get 5 product in three batch wise how to do that.
batch one 1 first 5 product(1-5)
batch one 2 next 5 product(6-10)
batch one 3 next 5 product(11 -15)
main code
{% for product in collection.products %}
{% endfor %}
{% for product in collection.products %}
{% if forloop.index <= 4 %}
# {{ product.id }} - {{ product.title }} -- {{ forloop.index }}
{% continue %}
{% elsif forloop.index >=4 and forloop.index <= 9 %}}
# second :--{{ product.id }} - {{ product.title }} -- {{ forloop.index }}
{% else %}
{{ forloop.index }}
{% endif %}
{% endfor %}
this was work for me.
Thank you for posting solution. These days many people just want to get work instead of answering people questions. This is forums where we post to get soultion. !!!
@NavB thanks for the posting your comment.
if you like the my solution explore my profiles. you can tag me and like the my answer resolution. that really help me answer on community.