Magento Get Product Data Programmatically
![Magento Get Product Data Programmatically](https://knowthemage.com/wp-content/uploads/2016/05/magento1-get-product-data-programmatically-803x490.webp)
![Magento Get Product Data Programmatically](https://knowthemage.com/wp-content/uploads/2016/05/magento1-get-product-data-programmatically-803x490.webp)
To retrieve product data programmatically, we will use resource model to get product collection. Resource Models contains the collection query directly with database to behalf of the model.
<?php $collection = Mage::getResourceModel('catalog/product_collection'); if(count($collection)): foreach($collection as $product): echo $this->__('Product with %s id %s is loaded successfully', $product->getName(),$product->getId()); endforeach; else: echo $this->__('No Product Selection was found'); endif; ?>