Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

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

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 02-13-2006, 01:02 PM
 
dfawdon dfawdon is offline
 

Advanced Member
  
Join Date: Feb 2006
Location: UK
Posts: 82
 

Default

Has anyone got this working with 4.017 ?
__________________
X-Cart Gold 4.0.17
X-AOM
Safetynet DSEFU
Easy Checkout
_________________
Reply With Quote
  #42  
Old 03-19-2006, 07:16 AM
 
bigmaggot bigmaggot is offline
 

Advanced Member
  
Join Date: Feb 2006
Posts: 74
 

Default

Seems to work fine on 4.0.17
__________________
X-Cart Gold v4.1.11
Reply With Quote
  #43  
Old 04-14-2006, 04:25 PM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

Hi,

I'm going to throw in my method for 4.1.0 rc4 in case some couldn't get the others to work.

include/register.php

find

Code:
$fillerror = (empty($uname) || !empty($error) || empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2));

replace with

Code:
$fillerror = (!empty($error) || empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2));

By deleting the error check for username, the cart will allow registrations without it.



Find
Code:
if (!@$error && $current_area == "C" && $active_modules["UPS_OnLine_Tools"]) {

Replace with
Code:
if (empty($uname)) $uname = $email; if (!@$error && $current_area == "C" && $active_modules["UPS_OnLine_Tools"]) {

Since we're not allowing the customer to enter a username, the code above will automatically populate the username field with the email the customer supplies.

Find
Code:
$profile_values['email'] = $email;

Replace with
Code:
$profile_values['email'] = $email; $profile_values['login'] = $email;

When the customer updates their email, their login will also reflect the change. There's only a slight problem with this. If the customer updates any of their other information, everything is fine. But when they update their email, they will get logged out. I don't know what causes the logout but their email/login still gets changed. What I did for my cart was add a little note "Note: If you change your email address, you will have to re-login for security purposes"

skin1/generate_required_fields_js.tpl

Delete this code to prevent check for uname

Code:
["uname", "{$lng.lbl_username|strip|replace:'"':'\"'}"],


skin1/main/register_account.tpl

You'll need to comment out the username fields:

Code:
{* Anonymous account *} {* <tr> <td align="right">Email Address</td> <td></td> <td nowrap="nowrap"> <input type="text" name="uname" size="32" maxlength="32" value="{$userinfo.login}" /> </td> </tr> *}

Code:
{* NOT anonymous account *} {*<tr> <td align="right">Email Address</td> <td class="Star">*</td> <td nowrap="nowrap"> {if $userinfo.login ne "" || ($login eq $userinfo.uname && $login ne '')} {$userinfo.login|default:$userinfo.uname} {else} <input type="text" id="uname" name="uname" size="32" maxlength="32" value="{if $userinfo.uname}{$userinfo.uname}{else}{$userinfo.login}{/if}" /> {if ($reg_error ne "" and $userinfo.uname eq "" and $userinfo.login eq "") or $reg_error eq "U"}<font class="Star">&lt;&lt;</font>{/if} {/if} </td> </tr> *} <input type="hidden" name="uname" value="{$userinfo.login|default:$userinfo.uname}" />

With the above code, I had to take <input type="hidden" name="uname" value="{$userinfo.login|default:$userinfo.uname}" /> out of the commented out code block because xcart needs it to finish the registration process. You can leave everything else commented out.


All of the above satisfies your needs if you want the customer to use their email as their login. The extra stuff below will add in a second field for them to type their email twice for confirmation:

skin1/main/register_contact_info.tpl or wherever tpl you have your email field in

Add this under the intial email block:

Code:
<TR> <TD align="right">Retype Email</TD> <TD><font class=Star>*</font></TD> <TD nowrap> <input type="text" id="emailtwo" name="emailtwo" size=32 maxlength=128 value="{$userinfo.email}"> </TD>

skin1/check_email_script.js
Add this:

Code:
if(document.registerform.emailtwo) { if(field.value==document.registerform.emailtwo.value){ } else{ alert("Please reconfirm your email address. It does not match."); document.registerform.emailtwo.focus(); document.registerform.emailtwo.select(); err = true; } }

before return !err; at the end of the file

</TR> [/code]
Reply With Quote
  #44  
Old 04-28-2006, 03:37 PM
  2019's Avatar 
2019 2019 is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 76
 

Default

xcell67 did you tried for final ver 4.1.0?
thank you.
__________________
// x-cart 4.1.9

X-CART CSS SKIN
XC SEO
IP Addresses in Users Online for all users
Color coded order status
Reply With Quote
  #45  
Old 05-06-2006, 02:52 PM
 
Callum Callum is offline
 

Newbie
  
Join Date: Apr 2006
Posts: 3
 

Default

Works great in 4.0.18 - thanks!
__________________
Callum.

X-Cart 4.0.18
X-Affiliate
X-Configurator
X-Feature Comparison
WebsiteCM CDSEO
WebsiteCM Remember Me
Reply With Quote
  #46  
Old 06-29-2006, 07:49 AM
 
taltos1 taltos1 is offline
 

Senior Member
  
Join Date: Mar 2005
Location: USA
Posts: 160
 

Default

Hello all! I need some expert advice. I am trying to get this patch to work.

ALTER TABLE `xcart_customers` ADD UNIQUE (
`email`
);

it does seem to work (i patched through the xcart admin), however, when I try to create a account to test this, and use the same email as an existing account after i press submit I get this error on a blank white page:
Code:
INVALID SQL: 1062 : Duplicate entry 'email@hotmail.com' for key 3 SQL QUERY FAILURE: INSERT INTO xcart_customers ....

Also, there are not duplicate emails in the database.

then it goes to "user created" dialog message but upon checking in the admin the user is not actually created. Any insight about this error.

Any insight please let me know..
__________________
X-Cart Gold Version 4.0.18
EWDHosting.com is my Host
Unix Servers
Reply With Quote
  #47  
Old 06-29-2006, 07:55 AM
 
mrkenzie mrkenzie is offline
 

Senior Member
  
Join Date: May 2006
Posts: 182
 

Default

Make sure you don't have the same email in the database for two different accounts.
__________________
Mike Kenzie
X Cart Gold Ver. 4.1.3
X-RMA
X-AOM
X-Product Comparison
Reply With Quote
  #48  
Old 06-29-2006, 08:09 AM
 
taltos1 taltos1 is offline
 

Senior Member
  
Join Date: Mar 2005
Location: USA
Posts: 160
 

Default

Nope, there are no duplicate emails. Any other ideas?
__________________
X-Cart Gold Version 4.0.18
EWDHosting.com is my Host
Unix Servers
Reply With Quote
  #49  
Old 06-29-2006, 08:40 AM
 
TL408 TL408 is offline
 

X-Adept
  
Join Date: Jan 2005
Posts: 549
 

Default

Quote:
Originally Posted by 2019
xcell67 did you tried for final ver 4.1.0?
thank you.
I would like to know as well. Anyone had a chance to test it yet?

Thanks.
__________________
Win2003 IIS6, PHP 5.2.3, MySQL 5.0.45 and X-Cart 4.1.9
Reply With Quote
  #50  
Old 07-05-2006, 03:36 AM
  2019's Avatar 
2019 2019 is offline
 

Advanced Member
  
Join Date: Dec 2004
Posts: 76
 

Default

any1?
__________________
// x-cart 4.1.9

X-CART CSS SKIN
XC SEO
IP Addresses in Users Online for all users
Color coded order status
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:45 PM.

   

 
X-Cart forums © 2001-2020