获取所有产品的列表

时间:2011-03-03 12:36:30

标签: magento

如何让商店列出所有与产品无关的产品?

1 个答案:

答案 0 :(得分: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
}