I am trying to observe the data being passed when an admin creates a new order in the backend. I do not want to observe front end orders that are being created.

I currently have the following:




public function handleCustomerFirstOrder($observer)
    $order = $observer->getEvent()->getOrder();
    Mage::Log('Order Info: ' . $order);

So far I am unable to even print the log to see what it contains. I get the following:

*Recoverable Error: Object of class Mage_Sales_Model_Order could not be converted to string*

I have even tried:

Mage::Log('Order Info: ' . print_r($order));

But that does not work either.

I am needing to observe when the admin creates a new order and capture the data. Specifically the customer ID, Order #, and item product Id #'s.

Any help would be greatly appreciated.



For the logging part you can for example use:

Mage::log('Order Info Start ------------------------');
Mage::log('Order Info End ------------------------');

For the other part of your question the following should be helpful:



foreach($order->getAllItems() as $item) {

Your Answer

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