I have the order object. From that I can get the shipping address id. Can anyone suggest how to derive Shipping address by shipping address id?


You could use the order_address object to get the shipping address:

 $address = Mage::getModel('sales/order_address')->load($shippingId);
// $shippingId is the id you get from order object.
$custName = $address->getName();
$custAddr = $address->getStreetFull();
$region = $address->getRegion();
$country = $address->getCountry();

or use


to see what are the methods that can be used on the address object ($address).

hope it solves your prob :)

| improve this answer | |

To get the Address from an order object you could simple do $order->getShippingAddress()


$order_id = 123; // put your order id here
$order = Mage::getModel('sales/order')->load($order_id);


$address = $order->getShippingAddress();
$custName = $address->getName();
$custAddr = $address->getStreetFull();
$region = $address->getRegion();
$country = $address->getCountry();
| improve this answer | |
  • I've already solved my question months ago. Even though appreciate the response. +1 – Sukeshini Dec 31 '13 at 3:05
  • $address is empty when i use $address = $order->getShippingAddress() but when i use $address = Mage::getModel('sales/order_address')->load($shippingId); It returns the address – Pradeep Singh Jul 28 '17 at 7:29

Shathish has given you a nice and correct answer.

However, you can use the singleton method and a query:

$shimnetId = "1"; // use your shipment id: 

$read = Mage::getSingleton('core/resource')->getConnection('core_read');

$query = "SELECT * FROM sales_flat_order_address WHERE entity_id='".$shipmentId."'";

$results = $read->fetchAll($query);


sales_flat_order_address contains both the billing and shipping address.

Hope it will work for you.

| improve this answer | |
  • 2
    I didn't tested your solution. But I think developing according to the way the Magento has developed is better rather than using direct SQL queries in the source. Anyway appreciate your suggestion. Thank you – Sukeshini Sep 25 '13 at 5:19

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.