Jump to content

Prestashop doesn't update stock correctly


Recommended Posts

Hi,

 

I have noticed that there are 2 tables in the database , ps_stock_available and ps_product_attribute that contain the quantity variable for the product. However, when you update the stock manually in the BO, the value is only saved to ps_stock_available. The value is correctly referenced in the BO but the FO gets the quantity from ps_product_attribute which is not updated.

 

Similarly, after a customer purchases a product, the quantity is only updated in ps_stock_available.

 

This causes problems with orders. I'm surprised nobody has brought this issue up yet. Is there anybody who can help? I've managed to add an extra method to the BO to ensure it updates both tables but I can't find where or in which file the call to decrease the quantity after a purchase is being done.

 

I'm using Prestashop version 1.5.4.1. I have done a fresh install of prestashop with the default theme seperately and the issue is still there so I'm pretty sure it is not my own files. Enable stock management option in the preferences menu has also been enabled.

Link to comment
Share on other sites

in prestashop 1.5.x stock datas are stored in the ps_stock_available tables (each attribute, each products have got own entry in this table). This is how it works, it's not a bug.

 

Hi, yes i understand that, but in the FO, when you are viewing a product, they check whether a product has available stock from the ps_product_attribute table instead. So if ps_stock_available shows quantity 0, but ps_product_attribute shows quantity 1, in the FO the customer can still order the item but the actual stock is 0.

Link to comment
Share on other sites

×
×
  • Create New...