his code change for X-Cart 4.4.x+ will allow your customers to recover their lost account information by Email or Username instead of one or the other.
Open /skin/common_files/help/Password_Recovery.tpl
Find:
Code:
{$login_field_name}
Replace with:
Open include/help.php
Find:
Code:
$account = func_query_first("SELECT id, login, password, email, usertype FROM $sql_tbl[customers] WHERE login='$username' AND usertype='$utype' AND status='Y'");
After add:
Code:
// WCM - Search by email if username doesn't match
if (empty($account))
$account = func_query_first("SELECT id, login, password, email, usertype FROM $sql_tbl[customers] WHERE email='" . mysql_real_escape_string(trim($username)) . "' AND usertype='$utype' AND status='Y'");
// / WCM - Search by email if username doesn't match