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

Filter collection by product id
 
insight
Member
 
Total Posts:  58
Joined:  2008-07-24
 

Hi All

I’m trying to do something quite simple that is turning into a bit of a mission.

I am trying to get a bunch of products from the db with specific product ids (not skus)

does anyone know the code for the id attribute:

$products->addAttributeToFilter(’WHAT GOES HERE’, ‘PRODUCT ID I WANT GOES HERE IE ‘6’’);

i have tried Id, ID, prodId but no luck.

Any help would be massively appreciated

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
vianetz
Guru
 
Avatar
Total Posts:  537
Joined:  2008-04-13
Munich, Germany
 

This can be done easier by Mage::getModel(’catalog/product’)->load(6); // untested wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
insight
Member
 
Total Posts:  58
Joined:  2008-07-24
 

Thanks for your help massi, unfortunately i was an idiot and managed to somehow post this twice, for some more answers to this issue please see the other thread.

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