I'm trying to get a shipping Address as whole like in the table sales_order_grid I had tried like below,

public function getordetails($orderid){
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $order = $objectManager->create('Magento\Sales\Model\Order')->load($orderid);

        $total = $order->getGrandTotal();        

        $shippingAddress = $order->getShippingAddress();   

        $shippingAddress = $order->getShippingAddress();   

        $telephone = $shippingAddress->getTelephone();         

        $address =  $shippingAddress->getStreet();  

        $city = $shippingAddress->getCity();

        return $address;


But here only able to get separated.. Is anyother way to get a like a whole address like in the table sale_order_grid Please Anyone help me Thanks in Advance.


Try this code snippet hope it will work:


$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$Address = $objectManager->get('Magento\Sales\Model\Order\Email\Sender‌​\OrderSender');


Also you can try this ( which will return an array:

  • here $order is a entity_id.?? – Ask Bytes Oct 12 '18 at 16:50
  • here $order is object, which you already getting : $order = $objectManager->create('Magento\Sales\Model\Order')->load($orderid); – Naveed Asim Oct 12 '18 at 16:51
  • i had received this error Class Magento\Sales\Model\Order\Email\Sender‌​\OrderSender does not exist – Ask Bytes Oct 12 '18 at 16:56
  • did you tried other one ? $order->getShippingAddress()->getData(); – Naveed Asim Oct 12 '18 at 16:59
  • remove starting "\" from "\Magento\Sales\Model\Order\Email\Sender‌​\OrderSender". i will be updating code too. – Naveed Asim Oct 12 '18 at 17:01

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.