我有类似的东西。我要做的是从结果列表中排除一个(或多个)类别。
$_category = Mage::getModel('catalog/category')->getCollection()->addFieldToFilter(array(
array('attribute'=>'---id or what---','eq'=>'---id of category---'),
));
$_category->getSelect()->order('rand()');
请注意,我会收到此错误:
PHP Fatal error: Call to a member function getBackend() on a non-object in /var/www/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 816