Magento Product data in Mage::getSingleton('catalog/product') not clearing if product id not available in database
Eg:
Product ID - 586 (Poduct present)
Product ID - 999 (Product not present in Magento)
Not Working:
$productModel = Mage::getSingleton('catalog/product');
$_product=$productModel->load('586');
echo $_product->getId()."<br>";
$productModels = Mage::getSingleton('catalog/product');
$_products=$productModels->load('999');
echo $_products->getId()."<br>";
Output:
586
586
Working:
$productModel = Mage::getSingleton('catalog/product');
$_product=$productModel->load('999');
echo $_product->getId()."<br>";
$productModels = Mage::getSingleton('catalog/product');
$_products=$productModels->load('586');
echo $_products->getId()."<br>";
Output:
586
Anyone please help!..