cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Fatal error in EE 1.14

Getting Fatal error in EE 1.14

Hello Team,

 

I am using Magento 1.14 EE, trying to get the order data inside observer. Here is my code:

$order = $observer->getEvent()->getOrder();
$_shippingAddress = $order->getShippingAddress();
$street = $_shippingAddress->getStreetFull();

Above code is working fine. I am getting all the information from the object. But also getting below error with getStreetFull()

Fatal error: Call to a member function getStreetFull() on a non-object in /home/springer/www/staging/app/code/local/VendorName/moduleName/Model/Observer.php on line 244

any help would be appreciated .

 

Thanks

 

1 REPLY 1

Re: Getting Fatal error in EE 1.14

Hi @PankajS_Magento,

Try the following code. 

$billStreet = $order->getBillingAddress()->getStreet()
$shipStreet = $order->getShippingAddress()->getStreet()

 
You got billing and shipping street array.


for the streetFull you need to load shipping address by shipping id. You can't get same in order object.
https://magento.stackexchange.com/a/8446

 

Might be it will help you!