0

I’m using this API to get all products: wp-json/wc/v3/products?per_page=100&category=15

It only takes products that belong to the vendor that is logged. How can i get all products from all vendors?

user10539558
  • 83
  • 1
  • 10

1 Answers1

0

Using -1 limit should give you all products from all vendors:

wp-json/wc/v3/products?filter[limit] =-1
nara_l
  • 664
  • 2
  • 9
  • 23
  • You can find information here https://stackoverflow.com/questions/48476534/get-all-products-from-woocommerce-using-rest-api – Hamza Arab Jun 13 '19 at 15:29
  • It still takes only products that belong to the vendor that is logged. – user10539558 Jun 13 '19 at 15:42
  • Try checking if you can get products from other vendor and see if you have any errors: `/wp-json/wc/v3/products?per_page=100&category=15&vendor=vendor_id` : replace vendor_id with any of the other logged out vendors – nara_l Jun 13 '19 at 16:02
  • I still have the same result, product that belong logged user – user10539558 Jun 13 '19 at 16:06
  • I don't know why this works with: /wp-json/wc/v1/products?per_page=100&category=15 – user10539558 Jun 13 '19 at 16:06
  • `/wp-json/wc/v3/products?per_page=100&category=15&include_vendor=[vendor_id1, vendor_id2,...]` - apparently you can include the list of vendor ids you want product from using the attribute `include_vendor`. – nara_l Jun 13 '19 at 16:09