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 answers
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
- UI Component(Table Rows) Taking Too Much too in LWC
- Twilio Salesforce integration (Chat Transcripts)
- How can I automatically apply dark and light themes using the Lightning Email Template Builder in Salesforce based on the user's system preferences?
- Sending Slack Message to channel from salesforce flow
- How to redirect to parent object after child record creation
- Creating File in Drag and Drop Enabled File Cabinet in Netsuite using Rest API from Salesforce
- tsql functions like REPLACE() failing in azure data factory pipeline connected to salesforce
- An unexpected error occurred. Please include this ErrorId if you contact support: 1878486530-323938 (1541428280)
- My requirement is that I have to create DLRS for 'the date when the most recent email was received'
- Declarative Rollup Summaries Deployment
- Trouble updating a Field in Salesforce via a Python Script
- Why custom favicon for Salesforce-powered website not showing consistently in Google search results
- Salesforce chatter photo upload trigger
- Disable Azure DevOps Pull Request being completed when Using Copado
- AppFlow s3 to Salesforce upsert fails
Related Questions in SALESFORCE-COMMUNITIES
- Declarative Rollup Summaries Deployment
- Salesforce MIAW: User message not sent from Community
- conga template specific for some object like invoice
- Generating barcode image in salesforce apex email with a generated sting in flows
- Salesforce experience cloud - Object page not displaying any object data
- Salesforce - Flexcard with SOQL Data source - Error - Invalid Descriptor Format: markup://c:should-intercept-webauthn[COMPONENT]
- Share record to community based on condition
- Salesforce CPQ Quote Template
- Customize a <select> tag in LWC
- How to fetch salesforce case details using CaseNumber via API call?
- Flow keeps restarting when 'Finished' event is handled
- Salesforce Community page not opening
- How to update related record field on delete of record?
- Custom objects per license limit for customer community plus login license
- How to get a refresh token after Expiring current access token in salesforce React-native?
Related Questions in SALESFORCE-CHATTER
- Salesforce chatter photo upload trigger
- Not getting any records from ContentVersion in Salesforce SOQL query,
- Apex | How i can create EmailMessage register in Chatter component of a custom object?
- Salesforce trial org: no more storage due to "Interaction Count Reports"
- Is there any way to undo the changes of code in salesforce org?
- How to know Order is placed from authenticated customer or guest In salesforce commerce cloud?
- Reply, ReplyAll and Forward buttons are not appearing on EmailMessage layout of claim related record
- DateTime.parse() not working if ICU is enable in salesforce
- Error: Incorrect parameter type for operator '<'. Expected Boolean, received Text
- Not able to append <Script/> tag to <div> index.html react.js
- Is there a way of using a row level formula to filter down to opportunities to the end of the month?
- Fetching the child element in a column from salesforce
- Task assign to multiple leads in salesforce using rest api
- How to upload files and attachments to the sobject record using REST API?
- How to get a list of all the attached files of the specific sobject record?
Related Questions in SALESFORCE-COMMERCE-CLOUD
- User object Expressions not working in B2B Commerce LWR site
- REST API to fetch data from Wordpress
- Why Salesforce Ocapi customer deleted not working?
- Eslint Parsing problem in sfra salesforce project
- OCAPI: exclude selected columns
- the record id keeps being undefined?
- Unexpected token ? error while deploying Cartridge changes of SFCC using GIT
- Is there a way to identify unused script files in SFCC?
- SFCC OCAPI ProductSearch API - Returning ALL Products
- Not sure how to connect an AJAX call to a controller and make it update a object
- how to write an ajax call to a controller
- How to track button click in salesforce using javascript
- Salesforce B2B Commerce (LWR) - "global.css" style
- What is an example of an ajax function that can grab data based off a state change?
- Sticky element isn't fully viewable on mobile when scrolling down
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?
Popular Tags
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)
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()