Bukimedia / PrestaSharp

CSharp .Net client library for the PrestaShop API via web service
GNU General Public License v3.0
155 stars 152 forks source link

Can't update quantity #278

Closed avrumi-kolman closed 5 years ago

avrumi-kolman commented 7 years ago

I'm trying to update the inventory available for a given product, but the Quantity property only has a get, no set.

https://github.com/Bukimedia/PrestaSharp/blob/26f0784f45c50d6a1dcd490dd84f26a2005f1a5d/Entities/product.cs#L28

Is there a specific reason for this? And if so, how else would I update the inventory available for any given item?

FrancMunoz commented 7 years ago

Hi! Just use Entities.product.associations.stock_availables. Get the product from Factories.ProductFactory or create new, change or add on associations.stock list and update the product. Hope it helps.

mowcixo commented 5 years ago

Hello @avrumi-kolman, as @FrancMunoz said, the product.cs quantity property is read only, to edit the product's stock, you have to edit its stock_availables.

You can find an example at #347.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.