WooCommerce.NET icon indicating copy to clipboard operation
WooCommerce.NET copied to clipboard

Can't filter by Dictionary Product.GetAll

Open chrisvell88 opened this issue 4 years ago • 4 comments

Hi,

I am using woocommerce.NET library to try and get Product by Purchase Note using the following code however, it seems it is kno recognizing my dictionary filter. Is there a way to get a product by attribute or by purchase not? or is there a list of supported Dictionary fiters?

Dictionary<string, string> pDic = new Dictionary<string, string>(); pDic.Add("purchase_note", txtBarcode.Text); App.wooProducts = await wc.Product.GetAll(pDic);

chrisvell88 avatar Mar 22 '21 21:03 chrisvell88

I don't think this is supported by WooCommerce, please check all available parameters: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products

XiaoFaye avatar Mar 24 '21 07:03 XiaoFaye

Thanks for your reply. From the parameter list it seems you can search by Attribute and Attribute term. So lets say i have an attribute called Barcode and has Term 12345. How can I code that in the dictionary please? can you show me an example?

Thanks

chrisvell88 avatar Mar 24 '21 15:03 chrisvell88

Any updates on this please? Need an urgent response

chrisvell88 avatar Mar 29 '21 18:03 chrisvell88

var myfield= "set your data here"; Example for sku: var pDic = new Dictionary<string, string>(); pDic.Add("filter[sku]", myfield);

this is the magic :)

landlogicit avatar Sep 12 '22 15:09 landlogicit