php - How do we get specific product collection using shopify API?
I want all the collections of specific products in Shopify. But I didn't get any proper information in Shopify documents as well. I have also reviewed below Stackoverflow link. But it is not working.
Can anyone help me that is it possible? If yes then how?
Reviewed Stackoverflow Link: https://stackoverflow.com/questions/14230720/getting-collection-names-of-products-in-shopify
You will need to use either the CustomCollection API (https://shopify.dev/docs/admin-api/rest/reference/products/customcollection#index). Which is
A collection is a grouping of products that merchants can create to make their stores easier to browse. For example, a merchant might create a collection for a specific type of product that they sell, such as Footwear. Merchants can create collections by selecting products individually or by defining rules that automatically determine whether products are included.
From here you can use this to retrieve all custom collections that contain a particular product
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.