You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
I would like to place a little code at the top of my website, that tells the website visitor if they are already logged in as a customer...basically it will look at the cookie status and say something like "logged in as bob".
Just kind of want to make it a bit more professional, so my returning customers know they are already logged in.
thanks.
Offline
Add this javascript to your ste_layout.txt file where you want the greeting and "login status" to be displayed. Two parts.
<script language=JavaScript><!-- var TodaysDate=new Date() var Hours=TodaysDate.getHours() if(Hours<12 ){document.write("Good Morning") } else{if(Hours<18){document.write("Good Afternoon") } else{document.write("Good Evening") } }//--></script> <script language=JavaScript><!-- cookiecheck=escape('(CGIVAR)fd_tracking_firstname(/CGIVAR)');if((cookiecheck==false)||(cookiecheck==null)||(cookiecheck=="")){document.write("! Welcome to my store<br><font color=#666666 size=1>(please <a href='(CGIVAR)seo_base_url(/CGIVAR)/page----custacct.html'>login</a>, or create your free <a href='(CGIVAR)seo_base_url(/CGIVAR)/page----custacct.html'>Customer Account</a>)</font>");} else{document.write(" (CGIVAR)fd_tracking_firstname(/CGIVAR)! <font color=#666666 size=1><br>(If you're not (CGIVAR)fd_tracking_firstname(/CGIVAR), please <a href='(CGIVAR)seo_base_url(/CGIVAR)/page----custacct.html'>Click here</a>)</font>") }//--></script>
The URLS are SEO'd, so you may need to replace these with the default ccp51 global urls if you are not using ATS's SEO mod.
Offline
Hi,
Can somebody please clarify this for me? The behavior I see with my site is that customers are not automatically logged in when returning to the site even though they may have a cookie with all their info in it. The cart will show items that were left in it from the last time (if it hasn't expired) but when checking out, they still have to enter their email and password to log in and populate their billing/shipping name and address info.
Is there something wrong with my site or am I missing something? If they've logged in before should it not ask them to login again when checking out? (I mean if they've closed the browser and then come back).
Thanks!
Dave
Offline
dtwg,12/31/2004 04:55:45 PM wrote:
Hi,
Can somebody please clarify this for me? The behavior I see with my site is that customers are not automatically logged in when returning to the site even though they may have a cookie with all their info in it. The cart will show items that were left in it from the last time (if it hasn't expired) but when checking out, they still have to enter their email and password to log in and populate their billing/shipping name and address info.
Is there something wrong with my site or am I missing something? If they've logged in before should it not ask them to login again when checking out? (I mean if they've closed the browser and then come back).
Thanks!
Dave
Hi Dave,
By default, yes it does work on forms throughout your site like email-a-friend and contact. These fields are automatically populated because the cookie is read.
However, checkout is usually a secure checkout, and the url changes to something different. Cookies are based on url, and won't exist during checkout.
Effectively what happens when someone logs in, their information is carried with them when they migrate to the checkout.
If the checkout wasn't secure, the fields would be populated. Try it!
Offline
Isn't that was this was?:
<script language=JavaScript><!-- var TodaysDate=new Date() var Hours=TodaysDate.getHours() if(Hours<12 ){document.write("Good Morning") } else{if(Hours<18){document.write("Good Afternoon") } else{document.write("Good Evening") } }//--></script> <script language=JavaScript><!-- cookiecheck=escape('(CGIVAR)fd_tracking_firstname(/CGIVAR)');if((cookiecheck==false)||(cookiecheck==null)||(cookiecheck=="")){document.write("! Welcome to my store<br><font color=#666666 size=1>(please <a href='(CGIVAR)seo_base_url(/CGIVAR)/page----custacct.html'>login</a>, or create your free <a href='(CGIVAR)seo_base_url(/CGIVAR)/page----custacct.html'>Customer Account</a>)</font>");} else{document.write(" (CGIVAR)fd_tracking_firstname(/CGIVAR)! <font color=#666666 size=1><br>(If you're not (CGIVAR)fd_tracking_firstname(/CGIVAR), please <a href='(CGIVAR)seo_base_url(/CGIVAR)/page----custacct.html'>Click here</a>)</font>") }//--></script>
Offline
Folks,
I have a question here..
i used this greeting codes and it displayed the greeting message even if i have not logged in. then i logged in and logged out, still the greeting is there with my user id in it.
it got my user id correctly from the cookie buried in my computer, but it does not know whether such user id is logged in or not.
did i miss anything here?
Offline