1

I am trying to get the customer object from the checkout_submit_all_after

This is the observer event for when the customer registers as new customer while also making a purchase. i.e on the one page checkout

i am able to catch the event in my method.

my only issue now is how to get the customer object .

i tried this but it came up with null.

$observer->getEvent()->getCustomer()
  • this event will not provide customer object, only order and quote object is provided. – Prasanta Hatui Sep 26 '18 at 15:02
  • it does if the user also regsiters. i checked it and saw that its there. but not sure how to pull it out – theSeeker Sep 26 '18 at 15:11
  • Please check my answer. – Rohan Hapani Sep 26 '18 at 16:49
  • Happy to help !! Happy coding :) You can give upvote also :) Thanks – Rohan Hapani Sep 27 '18 at 11:55
0

You can get customer details like this :

$order = $observer->getEvent()->getOrder();
$customer_id = $order->getCustomerId();
$customerData = Mage::getModel('customer/customer')->load($customer_id);
echo "<pre>"; print_r($customerData->getData());

Hope, It maybe helpful for you.

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.