I've got a big product collection about 68.000 items, when I loop through
the collection I'm trying to get all attributes by using $collection->getAttributes()
but it returns nothing.
When I load the products attributes like
$catId=604;
$collection = Mage::getModel('catalog/category')->load($catId)
->getProductCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('category_id', $catId)
->addAttributeToFilter('type_id', 'simple')
->addAttributeToFilter('status', 1)->load();
foreach($collection as $col) {
$prod = Mage::getModel('catalog/product')->load($col->getId());
$prod->getAttributes();
}
the performance is horrible so I want to get the attributes by using the collection but it doesn't work at all.
Any suggestions ?
$collection = Mage::getModel('catalog/product')->getCollection()->........
$catId=604; $collection = Mage::getModel('catalog/category') ->load($catId) ->getProductCollection() ->addAttributeToSelect('*') ->addAttributeToFilter('category_id', $catId) ->addAttributeToFilter('type_id', 'simple') ->addAttributeToFilter('status', 1)->load();
catalog/product_attribute_collection
resource model instead?