Is there a way to access user address information from a view added to the myaccount spa? Trying to pull the zip code of a user logged in, to utilize in a web service call.
m
Martin
03/16/2020, 9:12 PM
On SCA users doesn’t have an address for his profile, they have an address book, you can access that information using the ProfileModel instance
Martin
03/16/2020, 9:12 PM
Copy code
ProfileModel.getInstance();
Martin
03/16/2020, 9:14 PM
Then you can access to the addresses attribute and see all available addreses for that user, that the customer has addresses doesnt guarantee that is his zip code, maybe he bought things for another person, address, etc..
s
Steve Goldberg
03/17/2020, 9:32 AM
Martin is mostly right; if you're using SC or SCA 2019.1 or newer then you should use the UserProfile component instead