Jump to content

Product stock available mismatch


juanjico

Recommended Posts

Hi!

 

I'm developing a simple module that hooks to hookActionUpdateQuantity and update the stock of other products.

 

But, I'm using StockAvailable::getQuantityAvailableByProduct() to get current available stock and this still have the old value.

 

For example:

 

I buy one unit for a p roduct which current stock is 11. Inside hookActionUpdateQuantity(), the $params value passed have the correct new stock value for the product (10). But, if I call the StockAvailable::getQuantityAvailableByProduct() for the same product, I got the old stock value (11).

 

So, it's seems that the hook is called BEFORE the stock value is recorded on database.

 

Is this true or I'm missing something ?

 

Thanks!

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...