我正在尝试为这样的类别产品集合获取所有产品拇指
$category = Mage::getModel('catalog/category')->load($cat_id);
$products = Mage::getResourceModel('catalog/product_collection')
->setStoreId(1)
->setPageSize(10)
->addAttributeToFilter(
'status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED)
)
->addAttributeToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
->addCategoryFilter($category);
$productThumbs = array();
try {
foreach ($products as $product) {
$thumbUrl = $product->getThumbnailUrl(200, 60);
$productThumbs[] = array(
'entity_id' => $product->getId(),
'thumb_url' => $thumbUrl
);
}
} catch (Exception $e) {
error_log($e->getMessage());
}
它总是返回这样的占位符图片网址......
http://magentohost/magento/media/catalog/product/cache/0/thumbnail/200x60/9df78eab33525d08d6e5fb8d27136e95/images/catalog/product/placeholder/thumbnail.jpg
不知道我做错了什么...请指导。