Oft kommt es im Daily Business vor, das man sich durch alle Produkte wühlen muss.
Wer Magento kennt wird Wissen, das es schnell langsam wird.
Es gibt eine Alternative die die Ausführungszeit ca um den Faktor 10 beschleunigt.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | $i = 0;
$products = Mage::getModel('catalog/product')->getCollection();
$productCount = $products->getSize();
while ($i*500 < $productCount)
{
$products->clear();
$products->addAttributeToFilter('type_id', Mage_Catalog_Model_Product_Type::TYPE_SIMPLE);
$products->addAttributeToSelect(array('name','sku'));
$products->setCurPage($i+1);
$products->setPageSize(500);
foreach ($products as $product)
{
[ ... ]
}
$i++;
} |

Februar 5th, 2011 23:54
Hey in IE7 sieht dein Blog irgendwie kaputt aus.
Februar 6th, 2011 22:57
Ist mir leider nicht aufgefallen. Ich nutz kein IE
Aber Danke für die Info!