I am trying to get all the addresses of a customer using below code. But here I am not able to fetch all the details. If I try to print the array $customerAddres it give me memory exhausted error in terminal.
$customer = $this->_customers->load(3);
$addresses = $customer->getAddresses();
foreach ($addresses as $address) {
$customerAddress[] = $address->toArray();
}
foreach ($customerAddress as $customerAddres) {
echo $customerAddres['street'];
}
If anyone can help me to get complete addresses of a customer please let me know.
Best Answer
Try following way:
And now