Niroshan8889
Niroshan8889

Reputation: 43

Woocommerce Rest API Parameter filter

I am developing Ionic3 mobile app for e-commence web site using Woocommerce REST API.

This website contains different color shoes and bags I need to filter them respect to color using REST API.

I tried this way. But it returns all products .

http://www.example.com/wc-api/v1/products?color=black"

How can I do this?

Upvotes: 2

Views: 735

Answers (1)

Niroshan Ranapathi
Niroshan Ranapathi

Reputation: 3047

You can filter product using this way.

http://www.example.com/wc-api/v2/products?filter[pa_color]=black

Can be used pa_* for filter product by attributes

First you need to make sure your woocommece version is grater than 2.5. Otherwise you can't use this.

More details

Upvotes: 3

Related Questions