Magento Load Product By Id
![Magento Load Product By Id](https://knowthemage.com/wp-content/uploads/2016/05/magento1-load-product-by-id-803x490.webp)
![Magento Load Product By Id](https://knowthemage.com/wp-content/uploads/2016/05/magento1-load-product-by-id-803x490.webp)
To load product by id, use the load($id)
function by providing product id as parameter following the Product Model Class Mage_Catalog_Product_Model
.
<?php $id = 12; $product = Mage::getModel('catalog/product')->load($id);
A single product with object array will be loaded. To retrieve data simply use getId(); ?>
For Instance
<?php $product_id = 6; $product = Mage::getModel('catalog/product')->load($id); echo "View <a href='".$product->getUrl()."'>".$product->getName()."</a>";
The output of above code will be : View Demo Product