Magento 2 How to get Customer Shipping Address from the order number

Magento 2 How to get Customer Shipping Address from the order number


In ecommerce application when a customer places the order , the customer needs to fill the shipping 

address , this shipping address will be used to deliver the product to the customer doorstep. The

shipping address of the customer is store in the magento 2 and is associated with the order details, to

get the customer shipping address details and display in your application you can do it with the order

object



$orderId = 1;


        $orderDetailsArray = $objectManager->create('Magento\Sales\Model\Order')->load($orderId);



$shippingDetailsData =$orderDetailsArray->getShippingAddress();



#get customer shipping Region
echo $shippingDetailsData->getRegion();



#get customer shipping Postcode
echo $shippingDetailsData->getPostcode();



#get customer shipping LastName
echo $shippingDetailsData->getLastName();



#get customer shipping street
print_r($shippingDetailsData->getStreet());



#get customer shipping City
echo $shippingDetailsData->getCity();



#get customer shipping Email
echo $shippingDetailsData->getEmail();



#get customer shipping Telephone
echo $shippingDetailsData->getTelephone();



#get customer shipping suffix
echo $shippingDetailsData->getSuffix();



#get customer shipping vatid
echo $shippingDetailsData->getVatId();


Comments

  1. I am attracted by the presentation of this article. This information about shipping, is really good. I really appreciate your work. It is a gainful article for us. Keep posting. Thank you.
    international freight shipping companies

    ReplyDelete
  2. This blog is really helpful to deliver updated affairs over internet which is really appraisable. Shipping From China To Amazon Usa

    ReplyDelete
  3. I generally check this kind of article and I found your article which is related to my interest. Genuinely it is good and instructive information. Thankful to you for sharing an article like this.shipping company in Canada

    ReplyDelete
  4. An intriguing post that you have shared here. I got information from your article, It will truly help the individuals who need this data. freight forwarders Melbourne

    ReplyDelete

Post a Comment