Property ecotax is not valid (or any decimal field)
Library Version:
1.2.9
NuGet Package Url:
https://www.nuget.org/packages/PrestaSharp/1.2.9
Prestashop version:
1.7.6.9
Describe the Bug:
When I update a product decimal field, as ecotax or price, the request fail. I discovered via postman that the problem is because the serializer as a too big precision, when I shorten the fields it works perfectly (still 4 or 5 decimal precision). Am I the only one having the problem ? And if not how do you solved this please.
To Reproduce:
- var product = productFactory.Get(id)
- var dbProduct = ... ; // whatever you get your data
- product.ecotax = dbProduct.Ecotax;
- productFactory.Update(product)
It works if I set: product.ecotax = 0m. But doesn't work when 0m is from a variable.
A clear description of what you expected to happen.
Using Decimal.Truncate solved my problem. However I am still interesting in a clean fix.
Hi @ak293700
Sorry for the big delay It this bug only present with ecotax or also with price ?