XiaoFaye / WooCommerce.NET

A .NET Wrapper for WooCommerce/WordPress REST API
MIT License
393 stars 218 forks source link

Update variation stock_quantity #732

Closed tiziana-git closed 1 year ago

tiziana-git commented 1 year ago

If i use wc.Product.Update(...) the variation stock quantity is not updated.

If i use wc.Product.Variations.Update(...) it returns: {"{""code"":""product_invalid_sku"",""message"":""COD non valido o duplicato."",""data"":{""status"":400,""resource_id"":139}}"}

XiaoFaye commented 1 year ago

I can update it with below code:

wcObject.Product.Variations.UpdateWithNull(65, 54, new { stock_quantity = 5 });

tiziana-git commented 1 year ago

System.Reflection.PropertyInfo.GetValue(...) returned null. on if (prop.GetValue(item).ToString() == "")

when prop is sale_price