I want to select the list of all orders in Magento.
This is required for me to show the list of all the orders from magento in another PHP application presently I'm working on.
Also can some one write me the code using the Magento conventions such as Mage::
Im using Magento 1.4.2 version.
Thanks,
Mark
Try this:
That's header-level information. If you require line-item information / deeper information, you might use something like the following join:
Now, this is going to duplicate (cartesian product) all of the header information along with the line-item information. If you require something further, let me know, I'm a master at Magento EAV SQL :)
A bit late, but this might be useful (tested in Magento CE 1.7.0.2). The code is heavily commented for guidance.
Hope that helps someone!
This code uses the "Magento way" and accesses the data through the Model layer which insulates you from changes in the table structure (e.g. flat vs EAV). Create a new PHP file containing this skeleton code in the root of your Magento install (if elsewhere update the path for the first
require
statement).This gives you some examples of how to add attributes to the collection, you should be able to follow the examples to add more if required. It shows you how to filter by attributes, and sort by attributes. Examples also for echo'ing out the fields that you need.
HTH,
JD