A method to resolve if the current storefront customer is a Salesforce B2B Commerce guest user in an apex class is to use ccrz.cc_CallContext.isGuest. This property will return true if the current user is a guest user, or false otherwise. For example, if(ccrz.cc_CallContext.isGuest){ // do something for guest user } will execute some logic only for guest users. Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Call Context
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit