Hi Tawanda,
I think the first advice is: step back from your computer, take a piece of paper and a pen (or, if you're attached to your computer use something like Visio) and draw the process.
Once you do that, things will clear up. You'll see how and where people put stuff in their cart, when they are about to finalize their order and when they actually do finalize their order.
That's the point where you need to hook into your supply system. Basically, whenever someone confirms the order, that's where you need subtract the ordered quantity from the stock.
So, in the stored procedure that finalizes the order, you can add additional code to decrease the stock. Something like:
UPDATE Product SET Stock = Stock = @quantity WHERE Id = @productId
Just an example, but hopefully you get the idea.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.