Shop navigation and collections

Highlighted
Tourist
11 1 0

Hi,

 

When calling 

/api/2020-01/custom_collections.json

or

/api/2020-04/smart_collections.json

I can get all the collections for a shop, but this does not match the shop navigation.

- How can I retrieve the relation between collections and the navigation menu items?

- Is there a way to determine which collections are hidden?

 

Best regards

0 Likes
Highlighted
Shopify Staff
Shopify Staff
587 72 130

Hey @EasyAds,

 

The custom_collection object doesn't have any direct relationship to the online store navigation. While it's possible to place a collection link in the nav, that data isn't stored with the collection object so you won't be able to retrieve it through the API.

 

The API response includes the handle field for the collection. The handle field determines the URL for a resource on the storefront, so if a collection handle is t-shirt, the storefront URL will be {{shop_name}}.com/collections/t-shirt. Depending on your use case, you might be able use the handle to determine whether an item is in the store's navigation (by parsing the homepage HTML for example).

 

For the publication status of a collection, you can refer to the published field in the HTML response.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Tourist
11 1 0

@_JB Thanks for the clarification!

0 Likes