Kryptronic Software Support Forum

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.

#1 12-31-2004 12:51:32

thedot
Member
Registered: 05-24-2004
Posts: 162
Website

Customer Login Status, When They Arrive

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

 

#2 12-31-2004 16:15:44

Steven
Member
Registered: 04-21-2004
Posts: 84

Re: Customer Login Status, When They Arrive

Add this javascript to your ste_layout.txt file where you want the greeting and "login status" to be displayed.  Two parts.

Code:


<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

 

#3 12-31-2004 16:55:45

dtwg
Member
From: California
Registered: 11-15-2004
Posts: 1339
Website

Re: Customer Login Status, When They Arrive

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

 

#4 12-31-2004 17:04:26

Steven
Member
Registered: 04-21-2004
Posts: 84

Re: Customer Login Status, When They Arrive

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

 

#5 12-31-2004 18:24:30

thedot
Member
Registered: 05-24-2004
Posts: 162
Website

Re: Customer Login Status, When They Arrive

I don't have the SEO mod, but I can give this a try anyways.
do you have a suggestion for the javascript code then?

Offline

 

#6 01-14-2005 16:06:03

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19876
Website

Re: Customer Login Status, When They Arrive

Isn't that was this was?:

Code:


<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>



Nick Hendler

Offline

 

#7 01-14-2005 19:44:52

thedot
Member
Registered: 05-24-2004
Posts: 162
Website

Re: Customer Login Status, When They Arrive

Well I guess when I see "seo" in that code, it suggests that I need the seo module...which I will not be getting.

Offline

 

#8 02-08-2005 12:54:29

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19876
Website

Re: Customer Login Status, When They Arrive

Sorry I missed that.  Instead of:

Code:


(CGIVAR)seo_base_url(/CGIVAR)/page----custacct.html

Use:

Code:


(CGIVAR)common_url(/CGIVAR)&pg=custacct


Nick Hendler

Offline

 

#9 04-15-2005 13:58:12

gchen
Member
Registered: 11-11-2004
Posts: 22

Re: Customer Login Status, When They Arrive

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

 

#10 04-25-2005 11:49:37

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19876
Website

Re: Customer Login Status, When They Arrive

How do you manage the logout function?


Nick Hendler

Offline

 

Board footer