Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to retrieve collections in use (that have products) #465

Closed
richgcook opened this issue Dec 29, 2017 · 1 comment
Closed

How to retrieve collections in use (that have products) #465

richgcook opened this issue Dec 29, 2017 · 1 comment

Comments

@richgcook
Copy link

richgcook commented Dec 29, 2017

When retrieving a list of collections only (to create a filter list) is it possible to only return those with products? It returns them all even when blank but there doesn't seem to be an attribute where it shows a product count to then ignore?

client.collection.fetchQuery({first: 100, sortKey: 'TITLE'}).then(function(collections) {

I could then loop through collection.products on each and get the length that way but seems a little long winded and I'm guessing extra processing?

@rebeccajfriedman
Copy link
Contributor

At this time, you cannot filter by product presence. I'm curious what your use case is for having collections with no products in them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants