From the API docs, to list all custom collections for a certain product_id:
GET /admin/custom_collections.json?product_id=632910392
Response:
HTTP/1.1 200 OK
{
"custom_collections": [
{
"body_html": "<p>The best selling ipod ever</p>",
"handle": "ipods",
"id": 841564295,
"published_at": "2008-02-01T19:00:00-05:00",
"sort_order": "manual",
"template_suffix": null,
"title": "IPods",
"updated_at": "2008-02-01T19:00:00-05:00",
"image": {
"created_at": "2012-12-11T12:01:29-05:00",
"src": "http://cdn.shopify.com/s/files/1/0006/9093/3842/collections/ipod_nano_8gb.jpg?0"
}
}
]
}
Answer from Lydia Krupp-Hunter on Stack OverflowShopify Community
community.shopify.com › c › Shopify-Design › Targeting-a-specific-collection › td-p › 48371
Targeting a specific collection - Shopify Community
September 10, 2013 - Auto-suggest helps you quickly ... results by suggesting possible matches as you type. ... So my current template only allows a single collection on the homepage but I would like to include a second one. So in index.liquid I have added this below the first collection - <div class="row products masonry"> {% for product in collections.? %} {% include 'product-loop' with settings.frontpage_collection %} {% endfor %} </div> ... Let's say you have a collection with the handle of ...
Shopify Community
community.shopify.com › c › Shopify-Design › Show-collection-by-handle › td-p › 431558
Show collection by handle - Shopify Community
September 13, 2017 - <!-- /filters row --> <div id="centerCol"><div class="product-listing row">{% for product in collection.products %}<div class="{{ product_grid }}">{% include "product-grid-item" hoverzoom: "true" %}</div>{% endfor %}</div></div> <div class="infinitybutton">{% if settings.enable_infinite_scroll %}{% if paginate.next %}<div class="show-more"><a href="{{ paginate.next.url }}" class="btn btn--ys btn--xl">{{ 'collections.toolbar.button_show_more' | t }}</a></div>{% else %}{% if paginate.previous %}<div class="show-more" ><a class="btn btn--ys btn--xl disable">{{ 'collections.toolbar.button_show_more_disabled' | t }}</a></div>{% endif %}{% endif %}{% endif %}</div> {% if settings.enable_infinite_scroll %}<div class="divider--lg visible-xs"></div>{% endif %} {% endpaginate %} </aside>
Getting Collection Names Of Products in Shopify - Stack Overflow
0 How do we get specific product collection using shopify API? More on stackoverflow.com
Shopify get current collection - Stack Overflow
I am new to Shopify and learning it right now. I am on collection page, is there a way I can get current collection? For example, I have following collections category 1 Sub cat 1.1 Sub ca... More on stackoverflow.com
If product is in a specific collection, show specific code on page
So I am working on a product specifications table for our website and I would like for the code to show certain aspects of that table based off an if else or case statement. For example, we have various appliances and instead of having to make a product template for refrigerators, microwaves, ... More on community.shopify.com
Loop through a collection using a collection ID
Hi there, Trying to figure out how to loop through a collection using the collection ID. Is this possible? Right now I’m using the collection name, ie: collections['collection-name'].products but needing to transition away from that since the collection name can change over time. More on community.shopify.com
Videos
Shopify
ecommerce.shopify.com › c › shopify-discussion › t › how-do-i-iterate-over-products-in-a-specific-collection-164294
How do I iterate over products in a specific collection? - Shopify ...
November 15, 2013 - {% for collection in collections %} {{ collection.handle }} {% endfor %}
Shopify Community
community.shopify.com › c › Shopify-Design › Reference-Collection-By-Name › td-p › 153742
Reference Collection By Name - Shopify Community
January 24, 2015 - {% for product in collections.football-jerseys.products %} <h3>{{product.title}}</h3> {% endfor %} I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work. Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.
Shopify Community
community.shopify.com › c › Shopify-Design › If-collection-with-name-exists › td-p › 288796
If collection with name exists - Shopify Community
December 15, 2016 - Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type. ... I'm trying to turn my product vendor name into a link to a collection with the same name, but only if the collection exists. {% if settings.product_vendor_enable %} <p class="product-meta" itemprop="brand"> {% if collections[product.vendor].products_count != "0" %} <a href="{{shop.url}}/collections/{{product.vendor | handleize }}"> {{ product.vendor }}</a> {% else %} {{ product.vendor }} {% endif %} </p> {% endif %}
Shopify
shopify.github.io › liquid-code-examples › example › collection-list
Collection list | Shopify Liquid code examples
February 21, 2019 - --> {%- if collection.image -%} {%- assign collection_image = collection.image -%} {%- elsif collection.products.first and collection.products.first.images != empty -%} {%- assign collection_image = collection.products.first.featured_image -%} {%- else -%} {%- assign collection_image = blank -%} {%- endif -%} <a href="{{ collection.url }}"> <img src="{{ collection_image | img_url: '480x' }}" alt=""> {{ collection.title }} </a> </li> {%- endfor -%} </ul>
Shopify Community
community.shopify.com › english › shopify discussion
Loop through a collection using a collection ID
January 5, 2023 - Hi there, Trying to figure out how to loop through a collection using the collection ID. Is this possible? Right now I’m using the collection name, ie: collections['collection-name'].products but needing to transition a…