0

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.

2

$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');
  • unfortunately it didn't work for me.. all the time it's taking customer account email for order. – monojit banik May 22 '15 at 16:28
  • Updated my answer :) – Sander Mangel May 22 '15 at 16:40
  • hmm thats correct ... – monojit banik May 22 '15 at 18:27
1

I have used like $order->setCustomerEmail('info@example.com'); in saveorder function before save order & it works for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.