How can I get all products ordered by the customer, so I can put them in a array ?
1 Answer
- Get the customer ID from the customer object (or you can use the customer's email address).
- Pull the order collection and join with the order items table and filter on the ID/email.
- Call the toArray() method on the collection
-
1Thanks @Fooman. I know that exists, but the op did not specify what they wanted to do with the array or what information they needed in the array. My original version allows them to pick and choose which data goes into the final array. However, yours is more effecient Feb 13, 2015 at 21:00