What I have done:

I have few custom calculations to be done after placing an order for the customer in magento admin panel. I have hooked on to sales_order_save_after event inside tab inside my module's config.xml .

The Problem:

I need to get the customer_id of the actual customer for whom the order is been placed on the backend. How can this be done?

$_customer = Mage::getSingleton('customer/session')->getCustomer();

The above will give me the customer_id in case of front end, I need a way to get the customer's id when ordering from backend.

In case, the event "adminhtml_sales_order_create_process_data", is what I need to hook on, do let me know. because I am also kind of confused about which event to hook on.

Help me out.

  • Try $order->getCustomer() and reply here if it worked.
    – mbalparda
    Commented Dec 15, 2014 at 12:19

3 Answers 3


If your order already placed from admin - admin might have selected a customer or created using direct customer details.

If the order was placed from frontend then the order object will be having customer details.

By an case you will able to retrieve customer details of an order using


From this you will able to retrieve all details of that order's customer(If they were logged in)

  • Are you sure the customer object will be only filled if the customer is logged in?
    – mbalparda
    Commented Dec 15, 2014 at 12:35

This question seems to be answered here: get current customer from admin section

A summary:


you can get the customer in admin

to get a full name use this -> addNameToSelect()

$customerList = Mage::getModel('customer/customer')->getCollection()
foreach ($customerList as $customer) {
            $customreArray[] = array(
                'value' => $customer->getId(),
                'label' => $customer->getName()

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.