Hello I am new to salesforce commerce cloud and I am working on controller version of SFCC that is SGJC version. I wanted to know is there is any method or how will we know whether customer who has placed the order has placed as guest or as autheticated customer. I want to write a if else redirection logic. If placed order is from guest redirect to A.isml else redirect to B.isml. Any method from orderMgr class will be helpful.
How to know Order is placed from authenticated customer or guest In salesforce commerce cloud?
296 Views Asked by Mayuresh Gage At
2
There are 2 best solutions below
0
Hiep Nguyen
On
You can try the code same as below:
var order = OrderMgr.getOrder(orderNo);
if (!empty(order) && empty(order.getCustomerNo()) {
// Redirect to A.isml
}
if (!empty(order) && !empty(order.getCustomerNo()) {
// Redirect to B.isml
}
Ref docs.
Related Questions in SALESFORCE
- Flask-Restful, oauth, and Salesforce
- i am using Command line dataloader in Salesforce & create simple “process-conf.xml” file ,i want to give relative path insted of absolute path
- VBA automation to upload data into Salesforce
- "Operation in progress..." Never Ends When Previewing Rows in Kettle Spoon via Salesforce
- How to download attachments using c#
- Opportunity Field Dependency
- Create a dynamic SOQL Query using variable objects
- Salesforce - HubSpot API calls
- When does Time Dependent workflow rule executes?
- Customize 'Send with Docusign' Button in Salesforce
- How do I use a publicly hosted image as the background for a visualforce page?
- How to get access token and make salesforce rest api requests with paw?
- List button in Salesforce1
- Visualforce page is not refreshing after deleting a row from table
- Docusign Salesforce Logout/switch account
Related Questions in SALESFORCE-COMMUNITIES
- Cross origin issue in salesforce response(Access-Control-Allow-Origin)
- Need help in filtering the records in lightning application
- Cannot validate on saving new record
- Error: Lookups on activites must have a unique domain
- Can I set up a web form that will populate an opportunity in my salesforce
- Salesforce platform event duplicate events with ComeTd Client
- Custom Salesforce Lightning App giving "You dont have access to this record"
- Is there any way to download or preview a pdf file in mobile applications using jsPDF?
- How To Get Salesforce Code Coverage Report Similar to Sonarqube
- Combine two Salesforce SOQL Query
- is it possible to use lwc properties in Salesforce experience cloud components like Rich Content Editor
- Custom Multi Lookup LWC - Refresh Page After Record Edit -> Save
- How handle metadata api changes in Apex? (Ex: insert/update ApexClass)
- Error: The allow-in-static-site configuration tag is invalid when deploying my community to an organization
- How to get Scale Center data in Apex in Salesforce
Related Questions in SALESFORCE-CHATTER
- Soql query to access Topics associated with FeedItems in salesforce Chatter
- Salesforce OAuth2 missing_oauth_token
- Chatter Moderator User Security Token
- Error: Compile Error: Method does not exist or incorrect signature: ConnectApi.BinaryInput
- Fetching the child element in a column from salesforce
- OAuth lib for Chrome Extensions and Salesforce API
- Can I mention a group of users on a Salesforce Chatter post?
- Retrieving the changes happened in the posts liked by user - Salesforce chatter
- Embedding client Id in chrome extension
- consume salesforce chatter rest service from pure javascript
- Task assign to multiple leads in salesforce using rest api
- How to use the SalesForce API?
- Related to Chatter in Salesforce
- Need to access the name of field from map of Sobject
- Need to fetch records from approval History which are assigned to Queue of which currently Loogged in User is part of
Related Questions in SALESFORCE-COMMERCE-CLOUD
- OCAPI: How to refresh token after expiration?
- Unexpected token ? error while deploying Cartridge changes of SFCC using GIT
- Is there a way to identify unused script files in SFCC?
- the record id keeps being undefined?
- Decrypt AES-256 Cipher
- Can I pass parameters to a content slot from the calling ISML?
- Consuming an API from a Salesforce Commerce Cloud controller
- Salesforce Commerce Cloud - Add search subrequest in batch OCAPI
- Implement carousel in salesforce b2c commerce cloud
- How to remove a product from a category API wise in Demandware(sfcc)?
- Is there a way to log all incoming SFCC OCAPI requests?
- ISML conditional CSS class declaration
- I wan to show tooltip on clicking of a disabled button using vanila javascript (no framework, no library)
- How to know Order is placed from authenticated customer or guest In salesforce commerce cloud?
- Salesforce Commerce Cloud Shop API Order status update fails
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can try to use:
From the docs
There is also a difference between Registered and Authenticated customer. An Authenticated customer is a registered customer that is also logged, with an active authenticated session.
To check if the customer is authenticated you can use isAuthenticated() method instead of isRegistrered()