I am trying to do custom stock control, but it is not working quite yet. I am doing the stock control in the OrderLinesUpdating event. If the orderline's quantity is not within the allowed I would like to keep it at it's current quantity, but I am not sure how. It seems that the quantity has already been changed at this state. Am I maybe hooking into the wrong event or going about it in an wrong way?
Stock control and events
Hi,
I am trying to do custom stock control, but it is not working quite yet. I am doing the stock control in the OrderLinesUpdating event. If the orderline's quantity is not within the allowed I would like to keep it at it's current quantity, but I am not sure how. It seems that the quantity has already been changed at this state. Am I maybe hooking into the wrong event or going about it in an wrong way?
Cheers
Bjørn
Hi Bjørn
Are you using Tea Commerce 1.x or 2.x?
Kind regards
Anders
Hi Anders,
I am using version 2.0.1 :)
Cheers
Bjørn
You need to fetch the order from the DB using DependencyContainer.Instance.Resolve<IOrderRepository>().Get( storeId, orderId);
Kind regards
Anders
Thanks I am going to give that a try :)
Cheers
Bjørn
is working on a reply...