Posted on 09/01/2009 11:08:49
The reason why we haven't implemented stock decrease when you add to basket is that it would allow a competitor to add all avaliable units to basket which would cause the product to appear as sold out on you web site.
But using a NotificationSubscriber you could easily decrease the stock level when adding to basket and decrease when it is removed. Look at the options in Dynamicweb.Notifications.eCommerce.Cart.Line.
There are some considerations to be done when implementing the functionality you're describing. When does the customer "leave" the site? Is that when pressing an Exit button or when the session times out after 20 minutes? In that case Session_End() in Global.asa would be a good place to clean up after customers. But you can set up Ecom to save the basket in a number of days which would suggest that you can reserve an item for a longer period than just a session. You have to handle this or set up a business rule for this scenario in collaboration with your customer, the web shop owner. The same goes for the "sold-out" scenario described ealier. I also recomment that you do regular clean up jobs to make sure that nothing is lost upon break-down and special scenarios that no-one ever imagined would occur.
Some 4-5 years ago I implemented a B2B webshob integrated with Dynamics AX where the customer wanted to reserve a specified number of centimeters of carpet that should be cut off from a fysical roll of carpet in his warehouse. As far as I remember he ended up releasing the reserved carpet in his financial system on a scheduled basis for orders that were not completed. But that's not to scare you totally off. Of cause it can be done, it just takes a little bit of analyzing in advan:)