Hi Piper,
First I modified this code for 3.5.6:
Code:
#
# Check for errors
#
$uname_tmp=stripslashes($uname);
if ( strcmp($uname_tmp, $uname) !=0) {$error="Username ".$uname_tmp." is invalid! Please correct"; } else $error='';
$smarty->assign("error",$error);
$fillerror = (empty($uname) || !empty($error) || empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2) || empty($firstname) || empty($lastname) || empty($b_address) || empty($b_city) || (!empty($states) && empty($b_state)) || empty($b_country) || empty($b_zipcode) || empty($phone) || empty($email));
$fillerror |= ($emailerror = !func_check_email($email));
if (!(@$uerror || @$eerror || @$fillerror || @$error)) {
I took out $uname=tmp check and also the empty($unamee) in $fillerror.
so the code became this:
Code:
#
# Check for errors
#
$smarty->assign("error",$error);
$fillerror = (empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2) || empty($firstname) || empty($lastname) || empty($b_address) || empty($b_city) || (!empty($states) && empty($b_state)) || empty($b_country) || empty($b_zipcode) || empty($phone) || empty($email));
$fillerror |= ($emailerror = !func_check_email($email));
if (!(@$uerror || @$eerror || @$fillerror || @$error)) {
I did this so the cart wouldn't record an error if the username wasn't submitted.
Then I altered:
Code:
#
# Fields filled without errors. User registered successfully
#
$crypted = text_crypt($passwd1);
$s_address = trim($s_address);
$s_city = trim($s_city);
$s_zipcode = trim($s_zipcode);
if (empty($s_address) && empty($s_city) && empty($s_zipcode)) {
$s_state = $b_state;
$s_country = $b_country;
}
if (empty($s_address)) $s_address = $b_address;
if (empty($s_city)) $s_city = $b_city;
if (empty($s_zipcode)) $s_zipcode = $b_zipcode;
At the bottom I entered
if (empty($uname)) $uname= $email;
I did this so the cart would automatically fill the empty username field with the email address.
I left the Add New/ and Update customer tables alone. Let me know if you figure it all out.