X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Use E-mail address instead of username 3.5.x & 4.0 (https://forum.x-cart.com/showthread.php?t=8809)

balinor 05-08-2008 05:25 AM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
The problem with this mod is anonymous customers - in order to order, they need to enter their e-mail address each time, and the system won't allow them to check out as their e-mail already exists in the system. I really don't recommend this method be used until a way is found to allow anon customers to repeat order.

4worx.com 05-08-2008 10:58 PM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
That is no problem in my case. We've set up the shop to only allow checkout for users that are logged in (upon customer request).

Is it still possible then to use the piece of code as described in post #90?

fmoses 05-20-2008 09:29 AM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
Quote:

Originally Posted by B00MER
Use E-mail address instead of username for X-Cart 3.5.x & 4.0.

Let users use either their email address or username to login instead of JUST the username.

Edit include/login.php find:

Code:

$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE login='$username' AND usertype='$usertype' AND status='Y'");

Change to:

Code:

$user_data=func_query_first("select * from $sql_tbl[customers] where (login='$username' or email='$username') and usertype='$usertype' and status='Y'");

:!: Should work without troubles on 3.5.x and 4.0.x


this is the code that i'm finding in my x-cart, can i still replace the code with the above code and still have it work, i tried changing it to that above using dreamweaver, and then i couldn't login at all, kept on saying invalid login. Should i be using something else to edit my files? New to this and fumbling my way around. the only difference is the WHERE BINARY STATEMENT Thanks

$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY login='$username' AND usertype='$usertype' AND status='Y'");

I had changed it to this
$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY (login='$username' or email='$username') AND usertype='$usertype' AND status='Y'");

4worx.com 05-21-2008 02:02 AM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
Post #64 works fine!

JasonMiller1975 08-01-2008 10:05 AM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
I used a combination of posts #64, #67 and #78 to accomplish this. For my test accounts during install, I can still use my username to login with, but for all new customers, or pre-populated customers from an import, email address works for login now.

From a usability standpoint, people are becoming more expectant to use their email address for login purposes, not to mention they are more memorable than a sequentially generated naming convention created by a cart's admin.

Thanks for all your help guys!

Jason Miller

weckie 08-18-2008 10:07 AM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
I have this problem after i used the code from post #64.

"You have specified an incorrect user name. Only numbers (0-9) and lower-case letters (a-z) can be used. Please correct it. "

What to do?

skipmartin 10-17-2008 08:54 AM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
To get this to work in 4.1.x in login.php change:
Code:

$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY login='$username' AND usertype='$usertype' AND status='Y'");
to
Code:

$user_data = func_query_first("select * from $sql_tbl[customers] where (login='$username' or email='$username') and usertype='$usertype' and status='Y'");
$username = $user_date['username'];


The login script makes additional checks against the username, and it is still set as the email address which will cause those checks to fail until we reset the username to the the actual username.

JWait 10-18-2008 08:57 AM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
Quote:

Originally Posted by weckie
I have this problem after i used the code from post #64.

"You have specified an incorrect user name. Only numbers (0-9) and lower-case letters (a-z) can be used. Please correct it. "

What to do?


By default, version 4.1.11 and earlier versions of x-cart that have the the latest security patches do not allow anything other than numbers and lowercase letters to be used.
See the thread at http://forum.x-cart.com/showthread.php?t=41444 for a detailed explanation.

JWait 01-10-2009 06:30 AM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
Is there any chance this has been updated to work with later versions of X-cart? What we would like to do is eliminate the "username" entirely and have the customer enter an email address and password only.

This would mean a change to register, login, and recover password areas of x-cart. It would also mean that anonymous checkout would have to be disabled.

Anyway, is this something that others would be interested in working on and implementing in 4.1.x and 4.2 versions of X-cart?

balinor 01-10-2009 07:25 AM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
http://forum.x-cart.com/showpost.php?p=215306&postcount=101

Also, the security patches that came out in the last few months prevent special characters such as @ in the username.


All times are GMT -8. The time now is 01:18 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.