Bukimedia / PrestaSharp

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

Update a combination, it disappears from the carts #416

Closed fabiovannini closed 3 years ago

fabiovannini commented 3 years ago

Describe the bug

When you read a combination via webservice and update it without any changes (same dto), if this combination is in any Customer cart, it disappear from cart (always). The combination is updated right. Any error is trigged by webservice. Any message displayed to the customer.

Expected behavior

The combination must be remain in the cart (respecting business rules and domain logics)

Steps to Reproduce

Steps to reproduce the behavior:

1) Create a product 2) Create some combinations 3) Insert a combination in the cart on public side 4) Read this combination with web service 5) Update read combination from web service (same read dto unchanged) 6) This combination left the cart (ALWAYS)

Additional information

Sample code

`PrestashopCombination = new CombinationFactory(PrestashopApiBaseUrl, PrestashopAccount, PrestashopPassword);

var combinations = PrestashopCombination.GetByFilter(new Dictionary<string, string>() { // READ ALL OR ONE COMBINATION FOR TEST }, null, null);

foreach (var productCombination in productCombinations) { PrestashopCombination.Update(productCombination); }`

oromand commented 3 years ago

Thanks for reporting this. It would need deeper investigation, but most likely, if the API doesn't fail, it has to see with PS way of working; The Prestasharp library in itself it just a C# wrapper around PS standard endpoints.

fabiovannini commented 3 years ago

Thank you oromand, sorry for the inconvenience.

I opened an official ticket on Prestashop, it seems to be a problem on the Prestashop core: https://github.com/PrestaShop/PrestaShop/issues/23061

I close the ticket.