Page 1 of 1
Anon users who have completed and order but not registered
Posted: Thu Oct 15, 2009 7:47 am
by robgrigg
Hi,
I have run through an order as an anonn customer and the system has coped well with and created an anon login for me.
The site treats me as if I have logged on and customer or user .IsAnonymous returns false.
I can now go to my account and perform all the tasks I would do normally (as could anyone who used this machine with the cookie? or indeed anyone who sumply snooped the cookie over an unsecure connection.)
What I would like to do is three fold.
1) I'd like to know if a user is has registered with us. So something like .HasRegistered. how would I get this info? (count passwords?)
2) I'd like to be able to restrict access to the my account section to this user. instead I'd like to ask then to provide a password when they try to enter my account.
3) I do want to be able to distinguish this in the header to I can offer a link (instead of "Logout") something like, Forget me. When they click this I will ask then to register as well.
Is this possible? What would I need to do?
Cheers.
Rob.
Re: Anon users who have completed and order but not registered
Posted: Thu Oct 15, 2009 8:01 am
by robgrigg
Ok, a bit premeture.
So the Login for this user is only active during the life of the current browser session. phew!
I'd still like to know if the user has registered (entered a password) so I can keep prompting them nicely....
Cheers.
Rob.
Re: Anon users who have completed and order but not registered
Posted: Thu Oct 15, 2009 9:24 am
by mazhar
1) I'd like to know if a user is has registered with us. So something like .HasRegistered. how would I get this info? (count passwords?)
Code: Select all
if(!Token.Instance.User.IsAnonymous)
{
//Registered User
}
then about password counts
Code: Select all
Token.Instance.User.Passwords.Count
2) I'd like to be able to restrict access to the my account section to this user. instead I'd like to ask then to provide a password when they try to enter my account.
You can put some script on account page that first check against the user session for some valid password if its not there alert user to enter password. Upon a valid entry put entered password into session and allow user to see page.
3) I do want to be able to distinguish this in the header to I can offer a link (instead of "Logout") something like, Forget me. When they click this I will ask then to register as well.
You can create a new page and then edit the header scriptlet to accommodate this new link to new registration page.
Re: Anon users who have completed and order but not registered
Posted: Thu Oct 15, 2009 9:27 am
by robgrigg
Thanks Mazhar,
So you are saying that the way to tell if this user an anon but not registered user is for password count to be 0?
Cheers.
Rob.
Re: Anon users who have completed and order but not registered
Posted: Thu Oct 15, 2009 9:39 am
by mazhar
No I am saying that when some users logs in then Token.Instance.User.IsAnonymous will return false other wise it will be true. In fact when some one hit the website a user is created for him by having its anonymous properties set. Once he registers or logs in then we switch it to registered user.
Re: Anon users who have completed and order but not registered
Posted: Thu Oct 15, 2009 9:58 am
by robgrigg
I think you are missing my question.
there are 3 user states.
1) Anon - the site will ask for permission to log in to secured areas such as My Account.
2) Anon, but completed an order. The user looks like they are logged in for that session but have not registerd by providing a password. user.IsAnnonmous it false and they can happily trot around My Accont as well as see the reciept page, etc.
3) Loged in. A user has previously given us a password, we have set their user name to the email address and they can log in to the site and be given access to all the lovely secured areas.
What i am trying to assertain in code is, when they are in the second state. Then, on the reciept page, I can tease them to get them to enter a password.
How might I do that? The site knows because it lets me view My account after an order.
Cheers,
Rob.
Re: Anon users who have completed and order but not registered
Posted: Fri Oct 16, 2009 5:12 am
by robgrigg
Guys, this is an issue.
I need to be able to distinguish if a user is logged in because they have registered or because they have come through an anonymous checkout.
If a user buys anonumously, and then returns and uses the same email address. They will be asked to login or will not be able to proceed. This apears to be a bug which is a fairly large problem.
I am completely happy to be proved wrong here and for someone to explain how this works!
Cheers,
rob.
Re: Anon users who have completed and order but not registered
Posted: Fri Oct 16, 2009 9:49 am
by mazhar
The only thing you that can relate some anonymous user to some order is the Email as you described. You would need some customization work to accomplish your job. In order to check either this Email id is used for some order already or not you need these scripts some where Email id is available to you. This could be the time just before making a payment. Put some code that grabs the Email address from entered address and then executes a query to match any existing order against this Email id. If the result order count is greater then zero means user already placed an order so you can simply redirect him to registration page.
Re: Anon users who have completed and order but not registered
Posted: Fri Oct 16, 2009 2:42 pm
by robgrigg
Great, I get that, now back to the earlier question which I could do with an answer to if possible.
there are 3 user states.
1) Anon - the site will ask for permission to log in to secured areas such as My Account.
2) Anon, but completed an order. The user looks like they are logged in for that session but have not registerd by providing a password. user.IsAnnonmous it false and they can happily trot around My Accont as well as see the reciept page, etc.
3) Loged in. A user has previously given us a password, we have set their user name to the email address and they can log in to the site and be given access to all the lovely secured areas.
What i am trying to assertain in code is, when they are in the second state. Then, on the reciept page, I can tease them to get them to enter a password.
How might I do that? The site knows because it lets me view My account after an order.
I want to be able to tell when a user has completed an anonymous order. At this point user.IsAnonymous = False, they appear logged in and can go to the My account page. At this point I;d like to be able to know that a user is Anonymous BUT has not registered. In my originbal mail I suggested that I might do this my counting the passwords?
Any way, please can you tell me that either I am stupid and misssing something, or ackowledge that this state exists and help me to programatically assertain this state.
Cheers,
Rob.
Re: Anon users who have completed and order but not registered
Posted: Mon Oct 19, 2009 7:12 am
by mazhar
Let me explain what is happening.
When a user first hits any page of application, application creates an anonymous user for him/her. So Token.Instance.User will always return a user to you the only difference is that either this user will anonymous or registered. Coming back to my point again, when first some one hits the website application creates an anonymous user for him then if he is a registered user and he logs on in application, application changes his status from anonymous to registered one and loads his profile information.
If you have enabled the anonymous checkout then users will be able to place order without logging into website. Keep in mind the upon anonymous checkout application asks the customer to create account, you can see a checkbox for this purpose and if user checkouts by providing a password and enabling that checkbox upon order completion first a new user registration is created and then order is placed on that behalf. So in this case it was not an anonymous checkout and you have a registered user.
If customer makes a checkout without creating an account then it will be an anonymous checkout, no customer registration. This order doesn't link to any user. The only thing as I explained earlier will be Email address that was used by customer to place anonymous order that can be used to find out any order against that address.
Re: Anon users who have completed and order but not registered
Posted: Tue Oct 20, 2009 8:45 am
by robgrigg
great.
So in the final scenario, when the user checks out anonymously and then gets sent to the reciept page, the user.IsAnonymous is false and this will stay this way until tey close the browser or click logout. i guess this makes sense. You can tell this is the case because they will be presented with logout in the header (not login). they can click on myaccount and get to it.
In this scenario, I would like to be able to tell that the user has not regestered. I can't test user.IsAnonymous because it will say false. So I'd like to have something like, user.IsRegistered. As this does not exist, how can i assertain this?
Sorry, I know this thread has gone on for a while.
rob.