現在、カテゴリ内の製品と、どのカテゴリにも属していない製品があります。このコード スニペットは、Magento に最近追加されたすべての製品を提供します。
$_productCollection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter($preorderAttribute, array(
'eq' => Mage::getResourceModel('catalog/product')
->getAttribute($preorderAttribute)
->getSource()
->getOptionId($preorderValue)
))
->setVisibility(array(2,3,4))
->setOrder('created_at', 'desc')
->setPage(1, 12);
ただし、どのカテゴリにも属さない製品も提供します。1 つ以上のカテゴリに含まれる製品のみが必要で、どのカテゴリにも属さない製品は必要ありません。
上記のコードでこれを行うにはどうすればよいですか?