Ramakrishna
Ramakrishna

Reputation: 686

How to filter collection with more than one value for same field?

i'm trying to merge two collections which are filtered by same field but with different field value.But the problem is while i'm accessing to resulted merge collection its throwing error like getMethod can't call on non object magento.Give me any solution to get it work. Here is mycode

$shippedCollection = array();
$processingCollection = array();
$orderSCollection = Mage::getModel('sales/order')->getCollection();
$shippedCollection = $orderSCollection->addFieldToFilter('status','delivered_carrier');
$orderPCollection = Mage::getModel('sales/order')->getCollection();
$processingCollection = $orderPCollection->addFieldToFilter('status','processing');
$order = array_merge($shippedCollection->getAllIds(),$processingCollection->getAllIds());


echo $order->getData('increment_id');

Upvotes: 0

Views: 856

Answers (1)

Shivam
Shivam

Reputation: 2443

$orderCollection = Mage::getModel('sales/order')->getCollection()
                  ->addFieldToFilter('status',array('in'=>array('delivered_carrier','processing')));

echo "<pre>";print_r($orderCollection->getColumnValues('increment_id'));die();

Upvotes: 1

Related Questions