There are so many ways to do this, it would really help to see your .capx (or preferably a simplified version of it.) To give you specific help I need to know, for example, how you are storing inventories. Are you using arrays? (I would.)
As far as managing the purchase you might try something roughly along the lines of:
system-> repeat NumberofCustomers times
system-> pick each product
QuantityPurchased = int(random(0,QuantitySellerHasOnHand))
Then you'd deduct the quantitypurchased from the seller's inventory and add it to the buyer's inventory, and increase the seller's cash and decrease the buyers cash, etc.
Hope that helps at least a little!