REST Admin API add Custom Collection to another Custom Collection

Shopify Partner
10 2 0
Presently the /admin/api/2019-10/collects API allows a product to be added to a custom collection but it doesn't appear that it can add one custom collection to another custom collection i.e. to add a "sub/child-collection" to a "parent collection".

 

For example if I have a parent custom collection called "Shoes"  and a further 3 custom sub-collections below it called: "Running Shoes", "Formal Shoes", "Casual Shows" is there a way to add the 3 sub-collections using the API?

 

I presently have around 40 parent collections and 300 child collections and don't want to have to do this manually via the store dashboard. Is there an alternative using the API?

0 Likes
Shopify Staff
Shopify Staff
240 32 37

Hey @gdastgir,

 

Once you create a custom collection, you can use tags to filter / simulate a sub-collection.

 

So using the API, you might add all the shoes to the 'Shoes' collection and then tag specific shoes with 'Running shoes', 'Formal shoes', etc.

 

Your customers can find all the shoes at /collections/shoes and running shoes at /collections/shoes/running-shoes.

0 Likes
Shopify Partner
10 2 0
As I understand using tags to simulate a sub-collection doesn't allow those
tags to appear as a sub-collection from the Main Menu navigation.

There isn't much value in having a sub-collection if users can't
find/navigate to it on your website.
0 Likes
Highlighted
Shopify Staff
Shopify Staff
240 32 37

Hey @gdastgir,

 

You can achieve this with additional menus. For example, in the collection template, look for a menu with the same handle. If one is found, display the links as sub categories:

 

12-03-2sf2n-g9bw5.jpg

 

While you can create collections and tag products programmatically, there's no API for navigation, so this part would need to be set up manually.

 

Alternatively, collection.all_tags might be helpful to build a sub menu, but this becomes awkward if you have tags which aren't necessarily sub categories.

 

0 Likes