• WEBSITECM IS NOW
    Smack Digital Inc.

Recover Password By Email Or Username

Posted by and last updated Jun 23, 2014 05:38 PM

This 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:
{$login_field_name}


Replace with:
Email or Username


Open include/help.php

Find:
$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:
// 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

About the Author

Jonathan Peters Jonathan's founder of Smack Digital, a digital strategy agency that creates and executes online business success for executives who are highly motivated to quickly increase their market share. With more than two decades of experience on the web for clients ranging from non-profits to billion dollar enterprises, Jonathan's an expert in web development, eCommerce, software programming, search engine optimization and social media marketing.

Browse By Category

RSS Feeds

Don't miss out! Subscribe to our RSS Feeds to receive instant notification when new entries are added.

RSS Feed for All Categories
RSS Feed for X-Cart How-Tos
We choose our clients selectively.
Let's talk success. Apply to work with us.
Apply toWork With Us
Apply toWork With Us