开发者

Get list of all products

开发者 https://www.devze.com 2023-02-14 09:08 出处:网络
How do I get the store to list all products, independent of 开发者_运维知识库category?This should work in all Magento versions:

How do I get the store to list all products, independent of 开发者_运维知识库category?


This should work in all Magento versions:

$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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号