2011-03-03 135 views

回答

15

这应该在所有的Magento版本的工作:

$products = Mage::getModel('catalog/product')->getCollection(); 
//Magento does not load all attributes by default 
//Add as many as you like 
$products->addAttributeToSelect('name'); 
foreach($products as $product) { 
//do something 
} 
+0

感谢的人是什么类别.....你救了我.... – 2011-03-04 06:53:10

+0

$缺少的第一行。 – Gogol 2015-02-05 08:49:57