Sometimes we want to show remaining quantity of a product in our magento shop. Simple method to get product quantity is:
<?php (int) Mage::getModel(‘cataloginventory/stock_item’)->loadByProduct($_product)->getQty(); ?>
It can be helpful to show an alert message like below: