Bukimedia / PrestaSharp

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

Products position in category #280

Closed josep2902 closed 5 years ago

josep2902 commented 7 years ago

Hi,

I've set an order for the products in a category. When I update a product the position of this product is changed.

For example, having this:

Product 1 -> Position 0 Product 2 -> Position 1 Product 3 -> Position 2 Product 4 -> Position 3

and doing this:

lProduct = lProductsList.Last lFactoryProduct.Update(lProduct)

Without any change, only updating the same product, this is the result:

Product 1 -> Position 0 Product 2 -> Position 1 Product 4 -> Position 1 Product 3 -> Position 2

Is there something to do for update the product without change its position?

LuisDavidR commented 6 years ago

Hi,

try to set his position to null:

product.position_in_category = null;

mowcixo commented 5 years ago

Thanks for the answer @LuisDavidR, it should work.

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.