5
votes

I've cteated a custom module for my Magento 1.7.02 using "sales_order_place_after" event
I need to get Order Increment Id and the Phone number of the order address
I know how to get the Order Increment id:

$incrementid = $observer->getEvent()->getOrder()->getIncrementId();

But how do I get the phone number ?

1

1 Answers

12
votes

The complete order object is passed to the sales_order_place_after event, so you can get any property of the order object in this event observer, the same as you would anywhere else in Magento.

$incrementId = $observer->getOrder()->getIncrementId();
$phone = $observer->getOrder()->getBillingAddress()->getTelephone();