I can use this to get orders with status: complete, processing, closed.

$orders = Mage::getModel('sales/order')->getCollection()
            array('eq' => 'complete'),
            array('eq' => 'processing'),
            array('eq' => 'pending_payment'),
            array('eq' => 'canceled'),

However it doesn't return orders that are pending payment or canceled. How do I get the orders that are pending payment or canceled as well?

1 Answer 1


You can use the below code :

$orders = Mage::getModel('sales/order')->getCollection()
        ->addFieldToFilter('status', array('in' => array('complete','processing','pending_payment','canceled')));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.