Magento isInStock()

06.Jun.2012

Magento has an issue with $product->isInStock() so if you want to get information about whether the product is in stock or not, you can use following snippet:

if($product->getStockItem()->getIsInStock()) {
   echo 'Magento product is in stock';
} else {
   echo 'Magento product is out of stock';
}