我需要找到存在于类别 93 和 97 中的产品。到目前为止,我能够获得存在于类别 93 或 97 中的产品,但使用 AND 却没有运气。
我现在真的一无所知,现在已经做了很多谷歌搜索。
任何帮助表示赞赏!
到目前为止的代码:
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->distinct(true);
$collection->joinField('category_id',
'catalog/category_product',
'category_id',
'product_id=entity_id',
null,
'left');
$collection->addAttributeToFilter('category_id', array( 'in' =>
array('finset'=> '93'),
array('finset'=> '97')));
Magento 企业版 1.13.0.0