Jump to content

WOW! Product price changes when updating the active column of a product!


Recommended Posts

Hello guys,

 

I have a Prestashop 1.5.4.1 freshly installed yesterday and I was doing some regression on a module I am developping since quite a while.

 

For some operations of my module, I am updating the active column of that product in the database (table ps_product) and then call the traditional update() method to get this change commited in the database.

 

What was a damn bad surprise here where I noticed that changing this column only (active column) resulted in the price to change every time I change it (it litterally add money always to the previous price, so the price keeps going up). This is a terrible terrible situation.

 

The code is below:

 

if (!$productToEnable->active)

{

// Update the product database entry

$productToEnable->active = true;

if (!$productToEnable->update())

return false;

unset($productToEnable);

 

As you can see nothing fancy here, I update the active column, call update() and baaaaammm, the price changes. I suspect there is a cascade of methods call in the update() which creates this not to mention horrible and messy behavior.

 

Did someone already get this? I am very worry of the stability of Prestashop when I see this.

 

Is there anything convincing which you guys could tell me about the stability of the 1.5.4+ release?

 

Appreciate your input!

 

BR,

RaPhiuS

Link to comment
Share on other sites

×
×
  • Create New...