woocommerce_dart
woocommerce_dart copied to clipboard
The stock_status parameter does not work
I'm trying to get all the products in a category that have stock_status=instock but that parameter doesn't work. The same api consumed from PHP does work, so something in flutter is wrong. I've tried all the ways but I can't get it to work. Any help?
Future getProduct(int idCategory) async {
WooCommerceAPI wooCommerceAPI = WooCommerceAPI(
url: "xxx/",
consumerKey: "xxx",
consumerSecret: "xxx");
var productos = await wooCommerceAPI
.getAsync("products?stock_status='instock'&per_page=100");
return productos;
}
Try await wooCommerceAPI.getAsync("products?in_stock=true&per_page=100");