Jump to content

Hook to retrieve user-modified variations quantity during product save ?


Recommended Posts

I am building a module where I need to catch a backoffice quantity modification event (for product / variations) in real time and send the new quantity to an external API
right before the product get saved.

I am struggling in understanding which hook to use to get the actual user inserted combination quantity and not the "previous" product quantity , for multi-variation products.

So far I have tried with no success with => hookActionUpdateQuantity , ActionProductSave, actionObjectStockUpdateAfter ,  hookActionObjectCombinationUpdateAfter ,
but all hooks are returning the "old" quantity in $params (before DB update)

If I use the static method StockAvailable::getQuantityAvailableByProduct inside the hooks in my module, I am still getting the original product quantity and not the new one...

Any clue ?

 

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