I try to retrieve all the order collections, but when I observe by looping the collections and print the order id, I notice the order that has been invoiced is not inside the collection.

$collections = Mage::getModel('sales/order')->getCollection()

foreach($collections as $collection){
 echo $collection->getId();

1 Answer 1


Are you sure about that? I tested your code and displays all order ids. Even the invoiced, cancelled, new, processing orders. Actually it displays all the orders. I tested your code in

app/code/core/Mage/Cms/controllers/IndexController.php -> indexAction()

And when I open the homepage it displays all the orders. I can't figure why you don't get all the ids. Can you test exactly in the same place like me and tell me what displays on your homepage?

Your Answer

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

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