$product = Mage::getModel('catalog/product')->load(""""Here product ID"""");
$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct(""""Here product ID"""");
if(($product->isSaleable()) && ($stock->getQty() > 0) )
{
echo "In Stock";
}
else
{
echo "Out of Stock";
}
Magento
$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct(""""Here product ID"""");
if(($product->isSaleable()) && ($stock->getQty() > 0) )
{
echo "In Stock";
}
else
{
echo "Out of Stock";
}
No comments:
Post a Comment