Developer forum

Forum » Development » Validate Stock before order complete

Validate Stock before order complete

Rui Silva
Reply

 

I need to validate the stock amount of the products in the cart using a call to the ERP just before the cart is going to be submitted to the payment provider and has been upgraded to order.

The OrderIsPassedToCheckoutHandler notification cannot be the solution because in were the cart is already being transform into order and the stock in DW is already deducted.

I would like to have a notification that is fired just before DW enters the payment step and before the stock is deducted in DW. This way I can update the stock from the ERP before the order is complete and DW can make the stock validation based on the updated stock.

On my research for the solution I’ve used the BeforeCustomerAcceptedValueIsChanged notification that is in the last step of the checkout but this will not be 100% failsafe solution to the problem. Is there any better way to it?

Best,

Rui Silva


Replies

 
Nicolai Pedersen
Reply

Hi Rui

Currently BeforeCustomerAcceptedValueIsChanged  or orderSaved is the best option.

BR Nicolai

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

Any change we can have a notification right before DW checks the DB for available amount?

 

The goal is to have Live Integration reach out to the ERP and update the stock before DW does it's part.

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum