Developer forum

Forum » Development » Productstock reservation when added to shoppingcart

Productstock reservation when added to shoppingcart


Reply

Hi,

 

At the moment the productstock is decreased with the ordered amount when the order is completed.

 

I'm looking for a way (by writing an extender maybe) to reserve the stock amount when a customer adds the product to the shopping cart.

 

Does any of you already have experience with this kind of functionality ? And what's the best practice?

 

What to do when customer leaves the site without completing the order ? Is there a notification, so that the reserved stock amount can be undone ?

 

Kind Regards,

Emil


Replies

 
Reply

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:)

 
Reply

Good point, never thought about the competitor...

 

 

 

You must be logged in to post in the forum