How can I get all products ordered by the customer, so I can put them in a array ?

1 Answer 1

  1. Get the customer ID from the customer object (or you can use the customer's email address).
  2. Pull the order collection and join with the order items table and filter on the ID/email.
  3. Call the toArray() method on the collection
  • 1
    Thanks @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 Commented Feb 13, 2015 at 21:00

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.