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 Overflow
🌐
Shopify 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>
Discussions

Getting Collection Names Of Products in Shopify - Stack Overflow
0 How do we get specific product collection using shopify API? More on stackoverflow.com
🌐 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
🌐 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
🌐 community.shopify.com
0
April 14, 2022
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
🌐 community.shopify.com
0
January 5, 2023
🌐
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>
Find elsewhere
🌐
Shopify
shopify.com › ca › partners › shopify-cheat-sheet
Shopify Cheat Sheet — A resource for building Shopify Themes with Liquid - Shopify Canada
September 29, 2022 - Returns an array of filter objects that have been set up on the collection. Learn more ... Returns the handle of a collection.
🌐
Sunbowl
sunbowlsystems.com › blogs › how-to › how-to-setup-a-collection-in-shopify
How to Set Up a Collection in Shopify - Sunbowl
March 22, 2019 - If this is the case we can do a little trick via the URL: to get there. Go to the URL where we can see that the collection handle for this staff picks collection is '/staff-picks.'
🌐
Shopify Community
community.shopify.com › c › technical-q-a › add-collection-description-at-the-bottom › m-p › 1957355
Solved: Add collection description at the bottom - Shopify Community
February 23, 2023 - Replace 'your-collection-handle' with the handle of the collection that you want to add the second description to. You can find the handle of the collection by going to the collection page in your Shopify admin and looking at the URL.
🌐
Shopify
shopify.dev › docs › api › liquid › objects › collection
Liquid objects: collection
The handle of the collection. ... The ID of the collection. ... The image for the collection. This image is added on the collection's page in the Shopify admin.
🌐
HulkApps
hulkapps.com › home › shopify hub › a complete guide on how to get collection handle in shopify
A Complete Guide on How to Get Collection Handle in Shopify
April 11, 2024 - This identifier is crucial when customizing collection pages, implementing dynamic content, or creating conditional logic based on the collection being viewed. Accessing a collection handle can be achieved by tapping into Shopify's Liquid objects.
🌐
Shopify Community
community.shopify.com › technical q&a
If product is in a specific collection, show specific code on ...
April 14, 2022 - 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 i…
🌐
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…
🌐
Shopify Community
community.shopify.com › store design
Displaying Collection Name Under Product Title INSTEAD ...
March 22, 2022 - Hi there, I know that there is a way to hide the vendor name on product pages in Shopify. But here is what I am wondering: Is there a way to show the name of a collection that a product is in, in place of where the vend…