WooCommerce-REST-API-Client-Library icon indicating copy to clipboard operation
WooCommerce-REST-API-Client-Library copied to clipboard

List of products by category?

Open eros2187 opened this issue 7 years ago • 4 comments

Good morning I would like to know how it is possible to have a list of products by category I'm using this class but I will not return the products but arary only of the parameters of the category how can i do thanks !!

$category_id="16"; print_r( $client->products->get_categories( $category_id ) );

eros2187 avatar Jun 21 '17 09:06 eros2187

Have you found a solution for this? I have checked the global get() result and thus i came to this idea, but it does not work either: print_r( $client->products->get( array( 'categories' => 'Shirts' ) ) );

But i am sure that it has to be something into that direction.

qroft avatar Nov 21 '17 15:11 qroft

Ok, it looks like i found it out. It seems that it has to be like this: $category_name = "shirts"; print_r( $client->products->get(null,array('filter[category]'=>$category_name)) );

qroft avatar Nov 21 '17 23:11 qroft

@qroft answer is the one you need

radwaali avatar Apr 18 '18 10:04 radwaali

hi, I want to know it possible to have a list of products by tag??

soheilsalimidev avatar Aug 21 '18 21:08 soheilsalimidev