woocommerce_dart icon indicating copy to clipboard operation
woocommerce_dart copied to clipboard

The stock_status parameter does not work

Open bertux77 opened this issue 2 years ago • 1 comments

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;
  }

bertux77 avatar Jun 22 '22 09:06 bertux77

Try await wooCommerceAPI.getAsync("products?in_stock=true&per_page=100");

samarthagarwal avatar Jun 25 '22 06:06 samarthagarwal