Jump to content

Updating id_category_default breaks product in PrestaShop 1.7.7.5


wakawaka

Recommended Posts

Hi there,

I'm using Bukimedia Prestasharp with C# to update a product in PrestaShop. I specifically want to update the main category for a product.

It's a couple of simple lines of code that is essentially this in pseudo code:
 

prestasShopProduct.id_category_default = (long)(some existing category id);

prestaSharpClient.UpdateAsync(prestasShopProduct);

The rest call is succesful and I can see in the backoffice that the product has a new main category, which is the intention.

However, the product is missing several things on the shop preview (title is missing, navigation is broken and only showing part of the navigation tree, price is missing too, etc.), you also get an error whenever you try to complete a purchase with the product.

The error says something to the effect of "cannot load shopping cart, because an order is already place with this shopping cart".

If I then go into the backoffice and click save on the product that is broken, everything works as expected and the issue is gone.

However, I feel as if updating the id_category_default field on the product should be enough?

I don't have access to the MySQL database, but is there something I'm missing? Do I need to perform an extra step or update some other related value?

Thank you for your time.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...