2

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()
      ->addAttributeToSelect('*');

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

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, privacy policy and cookie policy

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