Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

select specific columns from product
 
ckosny
Guru
 
Total Posts:  349
Joined:  2009-02-28
Luxembourg
 

Hi there

I need to populate a select box with the ids and names of magento products.

At the moment I use this code to fetch the data from the db

$productColl Mage::getModel('catalog/product')->getCollection()
                    ->
addAttributeToSelect('name')
                    ->
exportToArray();

But this returns quite a lot of unused data (like the stock, type, attributeset id).
Is there a nice way to get really only the name and the id?

Thanks for any tips

Claudia

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top