Magento Get Product Data Programmatically

Magento Get Product Data Programmatically
()

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;
?>

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Leave a Reply

Your email address will not be published. Required fields are marked *