XiaoFaye / WooCommerce.NET

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

BatchUpdate on Variants doesn't update #744

Open tiziana-git opened 1 year ago

tiziana-git commented 1 year ago

I'm trying to update variants of a product with batch update, but it doesn't update anything. This is my code: Dim oVarProd As List(Of Variation) = Await wc.Product.Variations.GetAll(CULng(oProdMod(0).id), ParCall) For iCont As Integer = 0 To oVarProd.Count - 1 oVarProd(iCont).stock_quantity = 1 oVarProd(iCont).price = 10 Next Dim batchObj As BatchObject(Of Variation) = New BatchObject(Of Variation) With {.update = oVarProd} Dim RES = Await wc.Product.Variations.UpdateRange(CULng(oProdMod(0).id), batchObj)

Variations inside batchObj has the correct modifyed values

tiziana-git commented 1 year ago

Using the REST API LOG plugin, i can see the message is: { "id": 485, "error": { "code": "product_invalid_sku", "message": "COD non valido o duplicato.", "data": { "status": 400, "resource_id": 467 } } },