Skip to main content
1 of 4
srg
  • 465
  • 3
  • 12
  • 27

In magento 2 how can i programatically get customer full addresses in string type?

public function Address() {

 $customerId = "8"; $customer = $this->customerRepository->getById($customerId); $addresses = $customer->getAddresses(); $billingAddress = $customer->getDefaultBilling(); $shippingAddress = $customer->getDefaultShipping(); return $billingAddress; } 

In this code am only getting the id i want the address as string.please help me..

srg
  • 465
  • 3
  • 12
  • 27