【发布时间】:2013-12-07 01:12:46
【问题描述】:
我需要找到存在于类别 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
【问题讨论】:
标签: php magento magento-1.13