答案 0 :(得分:0)
$cat = Mage::getModel('catalog/category')->load($Catid);
$collection = Mage::getResourceModel('catalog/product_collection')
->setStoreId(Mage::app()->getStore)
->addCategoryFilter($cat)->addFieldToSelect('entity_id');
这里$ collection将列出产品ID
答案 1 :(得分:0)
查找特定类别的产品 -
$categoryIds = array(5,6);//category id
$collection = Mage::getModel('catalog/product')
->getCollection()
->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
->addAttributeToSelect('*')
->addAttributeToFilter('category_id', array('in' => $categoryIds))
希望这可以帮到你。