How to Change Registered Customer Billing Email at Checkout in Magento

billing-addressorder-emailorderssales-ordersales-quote

I am trying to implement one functionality where logged in user can able to change the billing email address on the time of checkout. I have tried to do that but all the time it updates customer account email address which I don't want. I have tried by updating email from quote & order both before save order function using $quote->getCustomer->setEmail(",,,,,") & $order->getCustomer()->setEmail("...") but unfortunately all the time it updates customer account email address but I need to update customer email id for particular order only (table- sales-flat-order).

Please suggest any solution.

Best Answer

$quote->getCustomer() retrieved the customer model. The email address for the order / quote is stored in the billing address object and in the quote object.

$quote->getBillingAddress()->setEmail('info@example.com');
$quote->setCustomerEmail('info@example.com');