Jump to content

[SOLVED]error trying to import customer


Recommended Posts

Hi everybody!

while trying to import a .CSV file with customer information I got this error, coud someone point me what could be the reason of this and possible how to solve this.

Thanks !

Hugo

p.s

this is the error :

Notice: Undefined variable: langFieldError in /var/www/vhosts/companyname.jp/httpdocs/store/escritorio/tabs/AdminImport.php on line 828

Link to comment
Share on other sites

Hi, I realized that the birthday field in my CSV file was incorrect dd-mm-yyyy and it must be yyyy-mm-dd, that solved the Notice message, but after I tried again the import process I got theses messages

104 errors
1. [email protected] (ID 10) cannot be saved
2. Duplicate entry '9-1' for key 1
3. Aline (ID 103) cannot be saved
4. Duplicate entry '102-1' for key 1
5. [email protected] (ID 112) cannot be saved
6. Duplicate entry '111-1' for key 1
7. [email protected] (ID 124) cannot be saved
8. Duplicate entry '123-1' for key 1.........
......

the duplicate key error comes from the AdminImport class where the customerImport method has this message sent to a customer instance
.... $customer->addGroups(array(1));
the thing is that right before this message in the customerImport method there is a $customer->add() message , well in the Customer class, in the implementation of the add() method there is this code:
$row = array('id_customer' => intval($this->id), 'id_group' => 1);
rtturn Db::getInstance()->AutoExecute(_DB_PREFIX_.'customer_group', $row, 'INSERT');
I think it is trying to insert two times the seme row in the customer_group table.

commentin the $customer->addGroups(array(1)) in AdminImport::customerImport method I bypasses the duplicate entry error, but I cannot find the reason for the other messages, is there any way to get more detailed error messages from prestashop.
thanks again

Hugo

Link to comment
Share on other sites

It sounds like a bug in the customer import. You should report it to the bug tracker.

You can try changing '_PS_DEBUG_SQL_' at the top of config.inc.php from 'false' to 'true'. That might give you more detailed error messages.

Link to comment
Share on other sites

well I think i found the root of my problem, the fact is that the customer data i am trying to import has some characters especific to the portuguese language like these : Ç , Â , ã , etc, thus every row that contains one of these is failing to insert, any idea how to solve this, my schema was created with utf8_general_ci and all tables in it.

thanks in advance.

Link to comment
Share on other sites

What version of PrestaShop are you using? PrestaShop v1.2.5 requires you to save the file as UTF-8. If that isn't working, I'm not sure how to help. In PrestaShop v1.3, the encoding scheme was changed to specific locales, iso-8859-1 encoded file by default. It looks like Portuguese is included in iso-8859-1.

Link to comment
Share on other sites

I am using PS 1.2.5.0, the file was exported from an excell documment as CSV, if I edit the csv file in notepad for instance the characters arer displayed correctly ( I guess that means the file is in utf-8)
if I use iso-8859-1 the import process doesnt work at all.

thanks

Link to comment
Share on other sites

×
×
  • Create New...