Magento: how to merge two product collections into one?

后端 未结 5 1402
逝去的感伤
逝去的感伤 2020-12-13 16:30

if i have two product collections is there a way to merge them into one?

for example (my final intent isn\'t to actually just get a collection of 2 cats, this is jus

5条回答
  •  时光说笑
    2020-12-13 16:58

    you can filter your collection directly without using 2.

    $products = Mage::getModel('catalog/product');
    $_collection = $products->getCollection();
    ->addCategoryFilter(2)
    ->load();
    

    or try using 'addItem' to add your results to a collection. See also in Magento wiki

提交回复
热议问题