Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Order Information (phone number) on sales_order_place_after event

Tags:

magento

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 ?

like image 366
Dan Raul Avatar asked Jan 06 '14 02:01

Dan Raul


1 Answers

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();
like image 65
Jim OHalloran Avatar answered Nov 15 '22 08:11

Jim OHalloran