Developer forum

Forum » Integration » "Check for stock status" with Live integration

"Check for stock status" with Live integration

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a project connected with NAv and I was wondering if the cart option "Check for stock status" would check the stock against the stock stored on the product or the Live stock.

I know the Live pricing also checks the stock but I am not sure if it is taken into consideration in this case.

Thank you,


Adrian


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Adrian,
there is  no special handling for this "Check for stock status" option, the Live integration should update the product stock information from NAV for the products that are in the cart or browsed on the product list page. You need the Live integraiton option "Enable live prices" be enabled for that, the option "Lazy load product info (&getproductinfo=true)" should be disabled.

Regards, Dmitrij

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Dmitrij,

Thank you for the answer.

We already have both options checked. The problem is related to the delays between adding to the cart and checking out.

A lot of customers are adding products to their carts and send the order once or twice a week. This means that the stock will clearly be different when they place the order.

That's why I need a way to check the live stock before placing the order. And I was hoping that this makes a lot of sense to be connected to the "Check for stock status" option since that is the purpose of it :)

Can I force a stock update for the products in the cart before making this check? I am thinking about a Notification or something similar in the API that would force a Stock update for the cart content.

Thank you,


Adrian

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Adrian,
it looks like it is not implemented out of the box in the Live integration.
So you can try to use our extensibility points.
Similar questions were answered previously:
https://doc.dynamicweb.com/forum/development/development/validate-stock-before-order-complete
https://doc.dynamicweb.com/forum/development/development/live-integration-index
Also as an other option you can look on Ecommerce.Notifications.Ecommerce.Cart.BeforeOrderValidation
notification and add a stock level ERP check there.

Kind regards, Dmitrij

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Dmitriy and Adrian,

 

I looked at this recently and there's no perfect notification for this. You would think that OrderIsPassedToCheckoutHandler to be the best one, but looking at DW's source code, that happens after Dynamicweb does a final DB stock validation.

 

In our projects we're using AfterCustomerAcceptedValueIsSet, but it requires us to do some templating ninja stuff to force to be updated to unchecked if the user cancels/goes back from the payment template (users do funny things). So a new notification better targetted OR changing when the OrderIsPassedToCheckoutHandler is triggered would be the best option IMHO.

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum