X-Cart Delete Duplicate User Accounts

X-Cart Delete Duplicate User Accounts

If your authentication mode is currently set to 'Username' and you wish to change to 'Email', you may be prevented, due to you having user accounts that share the same email address.

Deleting them manually can be a pain, especially if there are lots of them, but these SQL patches will delete duplicate accounts in one go!

Share

If your authentication mode (Tools > Maintenance) is currently set to 'Username' and you wish to change to 'Email', you may be prevented, due to you having user accounts that share the same email address.

Deleting them manually can be a pain, especially if there are lots of them, but these SQL patches will delete duplicate accounts in one go!

Make a database backup first, or at the very least, backup the 'xcart_customers' table!


OPTION 1 - Keep the oldest account, apply this SQL patch...

DELETE x1 FROM xcart_customers x1, xcart_customers x2 WHERE x1.id > x2.id AND x1.email = x2.email AND x1.username != 'admin' AND x1.username != 'provider' AND x1.username != 'master';

OPTION 2 - Keep the newest account, apply this SQL patch...

DELETE x1 FROM xcart_customers x1, xcart_customers x2 WHERE x1.id < x2.id AND x1.email = x2.email AND x1.username != 'admin' AND x1.username != 'provider' AND x1.username != 'master';


Note the ending code...

AND x1.username != 'admin' AND x1.username != 'provider' AND x1.username != 'master';

Add more admin / provider account usernames if necessary, so they are left untouched!

Tested. X-Cart Classic only. Hope it helps.

: *
: *
: *
Type the characters you see in the picture:
Captcha

*
Change next order ID value

Change next order ID value

If you've just opened a new store, you may not want customers to see low order ID's.

Protect company emails from spambots

Protect company emails from spambots

This will encode your company email addresses...

Detect HTTPS mode in Smarty

Detect HTTPS mode in Smarty

If you get a security alert when in secure mode, it's usually due to offsite elements such as SSL certificate seals, images and javascript that are not secure, in which case you can fix with this code...

More...