Change registered customer biliing email address on the time of checkout
-
13-12-2019 - |
Question
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.
Solution 2
I have used like $order->setCustomerEmail('info@example.com');
in saveorder function before save order & it works for me
OTHER TIPS
$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');