Jump to content

How to make prestashop update available stock when a order is placed?


alvesjc

Recommended Posts

Hello all.

 

would like to have prestashop reducing product stock in advanced stock management when a order is placed by the customer.

 

How can I accomplish this?

 

I've looked to AdminOrdersController.php as suggested on other post, but this seemed to be used only when you make stock changes in admin area.

 

I would like this to happen when the order is placed by the customer.

 

Help appreciated.

Link to comment
Share on other sites

Hi,

If you are Okay for core changes, then you can make changes in the validateOrder function in classes/PaymentModule.php. This function is always called whenever an order is placed, at the end of this function, You can write your logic. 

You can also use validateOrder hook (using the custom module) to reduce the quantity if you don't want to make changes in the core file. 

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