This is not a duplicate of this. I've referenced that question, but it didn't give me what I looking for.
I need to create a file with specific data on customer. I tried few methods I found on here, but no luck. I need to get information as follows,
<Adress> <StreetAddress1></StreetAddress1> <StreetAddress2></StreetAddress2> <City></City> <Country></Country> <County></County> <PostCode></PostCode> </Adress>
I need to get these info using ObjectManager. I lnow it's not the best way, bou for now, I only able to use it.
Update I need to call these from external file, not as a module or a plugin. So I cannot use any block methods. Only possible way if for me is using the Object Manager directly. But the problem is all the methods I've tried failed.
This below is the code from the answer you guys said my question is duplicate of,
$customerId = $_POST["customer_id"]; $customer = $this->_customerRepository->getById($customerId); $addresses = $customer->getAddresses();
but since I'm on outside PHP script, I cant use $this->_customerRepository or $customerRepository . I'm relatively new to Magento. So I'm not sure how to get things done most of the time.