need to show the availability of the product in the shopping cart
First of all, if stock is less then customer is trying to order, customer will not be able to do this (depends on a setting), so why you need to add this information at the shopping cart?
You may enable to show stock availability per each product, so customers may have a look on this and add proper value. To do this check both settings -
Display stock quantity