in the cart object, add a column for the available quantity, and save the available quantity in the add to cart button
you can then create a calculation in the cart object to force the quantity to be the available quantity is they try to order more than are available:
abs([Quantity] > [AvailableQuatity])?[Quantity] = [AvailableQuatity];''