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

Fetch products by category in Woocommerce REST API #6241

Closed
krrishnajee opened this issue Sep 12, 2014 · 5 comments
Closed

Fetch products by category in Woocommerce REST API #6241

krrishnajee opened this issue Sep 12, 2014 · 5 comments

Comments

@krrishnajee
Copy link

I'm using Woocomerce for my wordpress shopping cart. I'm connect my Android App to my Wordpress database through Woocommerce REST API. I need to get products by category on my App. There is no provision in the REST API to fetch product by category.

I tried by using the filter attribute:

https://mysite.com/wc-api/v1/products?filter[product_cat]=mobile&consumer_key=ck_9354534x&consumer_secret=cs_dx7345345

This is return me all the products. Max please help me bro.

@mikejolley mikejolley added the API label Sep 12, 2014
@claudiosanches
Copy link
Contributor

We don't have filter for it yet.
Ref: #5453

@maxrice
Copy link
Contributor

maxrice commented Sep 13, 2014

Yep no filter in place for this yet, in the meantime you can use the GET /products/categories endpoint to see the available product categories and then do the filtering client-side. I'll milestone this for 2.3, shouldn't be too difficult to add in. Ideally we'd add a filter like filter[category] which matches the semantics used already for product type (filter[type])

@maxrice maxrice added this to the 2.3 - UI Focus milestone Sep 13, 2014
@krrishnajee
Copy link
Author

Appreciate the reply Max. My Guess is when we do the filtering on client-side, may be the App will crash in some point. Because of loading a huge weight of data at a time. I'm confused and afraid of this point. Hope you may understand my point.

@maxrice
Copy link
Contributor

maxrice commented Sep 15, 2014

You could also use the fields parameter to limit the data returned which should reduce the changes of your app crashing from all the data, see http://docs.woocommercev2.apiary.io/reference

@krrishnajee
Copy link
Author

Thanks Max. Waiting for your next release and all the best.

@woocommerce woocommerce locked and limited conversation to collaborators Apr 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants