Jump to content

Product Image Import Problem


Recommended Posts

hi,

i am newly using prestashop and csv import is very important for me. when i try import just name and quantity, i get no any error but when i try import images i get this error.

Notice: Undefined variable: temp in /var/www/rota/controllers/admin/AdminImportController.php on line 646
Warning: fopen(): Filename cannot be empty in /var/www/rota/controllers/admin/AdminImportController.php on line 646
Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /var/www/rota/controllers/admin/AdminImportController.php on line 647
Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/rota/controllers/admin/AdminImportController.php on line 648
Warning: unlink(77): No such file or directory in /var/www/rota/controllers/admin/AdminImportController.php on line 649

 

Thank you

Link to comment
Share on other sites

i have made modification on AdminImportController.php and now it is working. Now i can import image.

Comment line was actual code

 

protected static function split($field)
{
	if (empty($field))
		return array();
	$separator = Tools::getValue('multiple_value_separator');
	if (is_null($separator) || trim($separator) == '')
		$separator = ',';
	do $uniqid = uniqid(); while (file_exists(_PS_UPLOAD_DIR_.$uniqid));
	$tmp_file = file_put_contents(_PS_UPLOAD_DIR_.$uniqid, $field);
	//$fd = fopen($temp, 'r');
	$fd = fopen(_PS_UPLOAD_DIR_.$uniqid, 'r');
	$tab = fgetcsv($fd, MAX_LINE_SIZE, $separator);
	fclose($fd);
	//unlink($tmp_file);
	unlink(_PS_UPLOAD_DIR_.$uniqid);
	if (empty($tab) || (!is_array($tab)))
		return array();
	return $tab;
}

 

Thank you

Link to comment
Share on other sites

×
×
  • Create New...