UserProfile in SCA

The UserProfile component enables you to retrieve information about the current web store user. The information available depends on whether the user is currently logged in, is a registered user but is not logged in, or is an unregistered user.

 If the visitor is logged in as a user, we can get details such as the user’s first name and last name, the user’s addresses, credit limit, current balance, and more. It may also return custom fields from the customer record.

var userprofilecomponent = container.getComponent("UserProfile");
 userprofilecomponent.getUserProfile().then(function(profile) {
		firstname = profile.firstname;
		lastname = profile.lastname;
		fullname = firstname + " " + lastname;

	console.log("User: Full Name: " + fullname);
		});
https://system.netsuite.com/help/helpcenter/en_US/APIs/SuiteCommerce/Extensibility/Frontend/global.html#UserProfileInfo

Leave a comment

Your email address will not be published. Required fields are marked *