Inventory Tracking

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
sloDavid
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 92
Joined: Thu Feb 25, 2010 12:34 pm

Inventory Tracking

Post by sloDavid » Fri Mar 16, 2012 1:42 pm

It looks to me like a product's stock level is not reduced until after the payment is completed. (e.g., Credit Card captured.) Anybody have a good idea on how to decrement the stock level as soon as the order itself is created? Right now, I'm thinking that I'll have to do that, and then increment the stock level upon payment completion, somehow.

sloDavid
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 92
Joined: Thu Feb 25, 2010 12:34 pm

Re: Inventory Tracking

Post by sloDavid » Tue Mar 20, 2012 5:11 pm

I recently noticed the Order Statuses page in the Admin panel. (Configure > Order Statuses), and that I can set the "Payment Pending" status to Destock, so that's good. But during the CheckedOut event, the product's InStock value still wasn't changed. ((OrderDataSource.Load(e.OrderId)).Items[n].Product.InStock) So if anyone else runs into this situation, beware.

To get the newly updated stock level, I had to load a ProductCollection of all the products (ProductDataSource.LoadForCriteria()). Only then was I able to update each Product as necessary (and then save the ProductCollection). I'm not sure why the Items[n].Product.InStock wasn't updated, but when loaded from ProductDataSource, the InStock quantity DID have the new value.

My only hope is that it wasn't a symptom of an asynchronous process that simply happened to finish between the two data source loads. If that's the case, then I may not be able to guarantee that this will always work as it ought to.

Post Reply