I have already posted a question regarding this, how to update customer and order details from magento to ERP using event observer?

my files are as follows:

Config.xml [app/code/local/Wli/Checkoutdemo/etc]



<?xml version="1.0"?>

Observer.php [app/code/local/Wli/Checkoutdemo/Model]


class Wli_Checkoutdemo_Model_Observer {

    public function Checkoutdemo(Varien_Event_Observer $observer) {
        $event = $observer->getEvent();
        $customer = $event->getCustomer();
        $order = $event->getOrder();


I need to get the details which are entered by the customer here.

after placing the order I didn't get anything?

what's wrong here?

what are the steps I have to follow here? (I am new to Magento, if anyone has any idea pls share here)

  • What is actually the error/problem you are getting here? Commented Sep 2, 2015 at 9:11
  • always dump data to log files , you can use Mage::log('Your custom log here'); dont use print_r and exit
    – inrsaurabh
    Commented Oct 16, 2017 at 6:19

2 Answers 2


You can get a lot of customer details directly from the order object


etc... You can see a lot of them by looking at the class comments in app/code/core/Mage/Sales/Model/Order.php

But you can also get the customer object from the order too like so

$customer = $order->getCustomer();

The event sales_order_place_after sends the order and only the order during the dispatch process.

Mage::dispatchEvent('sales_order_place_after', array('order'=>$this));

This means that your code $customer = $event->getCustomer(); will not return anything. But you should be able to get the complete order information from $order = $event->getOrder();

This will give you a model of type Mage_Sales_Model_Order which will contain all the information about the order itself. From this model you should be able to get anything you need to know about the order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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