Magento – How To Get All the Products


To fetch all the products in Magento you can use the below code –

$prodobj = Mage::getResourceModel('catalog/product_collection')->getData();

$prodobj is an array which will contain all the products, each as an array. The values returned for the products are –

[entity_id] => 1
[entity_type_id] => 4
[attribute_set_id] => 4
[type_id] => simple
[sku] => product-a
[has_options] => 0
[required_options] => 0
[created_at] => 2011-01-12 19:01:24
[updated_at] => 2011-01-12 19:01:24

This entry was posted in Magento, PHP and tagged , . Bookmark the permalink.

3 Responses to Magento – How To Get All the Products

  1. Catalin Dragos says:

    I have a question.
    I would like to get the name and price of all products.
    Is it possible to do in a similar fashion?
    Thank you

  2. xyz says:

    {{block type=”catalog/product_list” name=”home.catalog.product.list” alias=”products_homepage” template=”catalog/product/list.phtml”}}
    But with this code we don’t get pager in page listing

  3. Nitin Kumar says:

    At initial level it is the best.Thanks..

Leave a Reply

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