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 –

Array(
[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
)

3 comments

  1. Hello,
    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. {{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

Leave a comment

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