$_customer = Mage::getModel('customer/customer');
$_customer->loadByEmail('example@example.com');

$orders = Mage::getResourceModel('sales/order_collection')
    ->addFieldToSelect('*')
    ->addFieldToFilter('customer_id', $_customer->getId())
    ->addAttributeToSort('created_at', 'DESC')
    ->setPageSize(1);

ID
echo $orders->getFirstItem()->getId();

Leave a Reply

Your email address will not be published. Required fields are marked *