Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

opencart, importing customers

I have 3 queries regarding this.

I have a new Opencart site and 500+ customers to add. I've found a couple of import customer extensions, but support appears to have gone AWOL and there doesn't seem to be a working version for 1.5.5.1 so I'm looking at importing into mysql with xls files.

My queries are as follows:

Query 1:There seems to be 2 tables I need to upload: (a) Address; and (b) Customer. Are these the only tables that need changing?

Query 2: I see the passwords are MD5 encrypted. I have passwords for all 500+ customers already - do I have to convert these passwords into MD5, or can I use un-encrypted passwords and the db do the encryption for me?

Query 3: What do I do about the Salt field in the Customer table? Can I leave this blank?

3 x MTIA !

like image 476
circey Avatar asked Mar 08 '13 01:03

circey


1 Answers

Query 1 : these should be enough (there are other tables like customer_ip etc but that should not cause any problem

Query 2 : database will not encrypt passwords for you

Query 3 : no you can't leave salt empty (unless you edit the password checking code, which is obviously not recommended)

so what you should do ?

for each customer first generate salt like this

 $salt = substr(md5(uniqid(rand(), true)), 0, 9)

then encrypt password like this :

$password = sha1($salt . sha1($salt . sha1($password)))

then save these variables in database.

you can have look at system/library/customer.php and catalog/model/account/customer.php , to get an idea how things works

like image 125
Chetan Paliwal Avatar answered Nov 19 '22 01:11

Chetan Paliwal