Let An Expert Help: (888) 336-3395

Magento - Get All Customer Order by Email

From time to time everyone finds them selves in a position where they are faced with a scenario they have never encountered before.  Tonight I was attempting to get all orders for a customer based on the customer email address.. While there are probably several ways to do this, I found a nice query that is quick, and efficient.

$orderCollection = Mage::getModel('sales/order')->getCollection();
$orderCollection->addFieldToFilter('customer_email','email@domain.com');

Happy coding, hope this helps next time you're working on Magento

Say Hello

Near the Cleveland, Akron or Medina area and want to stop by our office? Let us know and we'll get the coffee and whiteboards ready. :)

437 Lafayette Road
        Medina, OH 44256

(888) 336-3395

welcome@ethode.com