Hello, I have my products with name, quantity, reference, short desc, desc, and url images mapping images to the same domain, under the shop installation root, all of this in a .cvs file renamed as .txt then I got to Import and upload this product list, map acordingly to the proper fields using the import wizard, then I let the prestashop import do their things, it takes a while to do the import (about 40 prodcuts with 5 images each) and then it says OK, file imported ok, but no images on products... I have several questions, for instance, how many characters (field lenght) is capable the Images URL field is? Why is that although the wizard gives no error I dont see my images? images were uploaded using FTP and are on average, 600 kb each.
Any ideas kindly appreciated
Any ideas kindly appreciated
Here's a quick checklist
1. make sure the folder that you've ftp'd the images to have the permissions set at 777
2. make sure the products all have a category id number or else the images will not appear.
3. make sure that in your database, products are called directly: http://www.yourstore.../product333.jpg
Also, you do not need to convert "csv" files to "txt"
1. make sure the folder that you've ftp'd the images to have the permissions set at 777
2. make sure the products all have a category id number or else the images will not appear.
3. make sure that in your database, products are called directly: http://www.yourstore.../product333.jpg
Also, you do not need to convert "csv" files to "txt"
PetsRight.com
http://www.petsright.com
http://www.twitter.com/petsright
My Interview In Practical Ecommerce Magazine
http://www.practical...ime-s-The-Charm
http://www.petsright.com
http://www.twitter.com/petsright
My Interview In Practical Ecommerce Magazine
http://www.practical...ime-s-The-Charm
I meant to say "product id".. not category id...
PetsRight.com
http://www.petsright.com
http://www.twitter.com/petsright
My Interview In Practical Ecommerce Magazine
http://www.practical...ime-s-The-Charm
http://www.petsright.com
http://www.twitter.com/petsright
My Interview In Practical Ecommerce Magazine
http://www.practical...ime-s-The-Charm
Hi, Ivé checked the CHMOD to 777, cat_id on every product, uploaded and still no joy... Documentation good be a good thing; perhaphs the images are too heavy, perhaps the field Images URL (x, z, y) is too short to fit 255 char lenght, I don´t know why is this happening but it is frustrating and time consuming. Documentation regarding where to find the scripts that take care of the inner workings as per how to upload an image would be valuable too as I can try to make a client side desktop app to program all those task and then do it attendant-less, I have many other things to do but having myself 3 days waiting until 78 mb of images are uploaded by hand... I find amazing such a good software with such flaws...
From 1239385453:
I meant to say "product id".. not category id...
Is it not this an auto generated field? which format? numeric? precision? lenght? rules?¿? Where is this documentation, please?
Thank you for your kind help
Ok, I´ve added the product_id field and guess what? It only added 2 images from 120; we have a relatevly small catalgo, 39 products, and the cvs has 4 images per product, I´ve done the thumb regenerate routine and nothing, only 2 images are showing, the rest nothing. I´ve checked one by one, to be available as the location indicated as image URL in the cvs file and are correct, I don´t know what could be...
Thanks again
Thanks again
Ok, the issue seems to be that fields porting more than one image URL does fail; I am checking and the products indicating only one image URL does work... Since I have comas "," in many product descriptions, I am using the "|" to delimitate fields, and as file delimiter (default import wizard options) we have the "," to delimitate fileds and another stuff wich I don´t know what is it for, in spanish the translation is "file delimiter", default option ";" ehat is this for? does this has something to do PS fails to parse the content of the Image URL?¿? Any workarounds?
Thank you all for your help, again!
Thank you all for your help, again!
Almost solved. The translation in backoffice for spanish is wrong, it shoud say 'delimitador de campo' instead of 'delimitador de archivo' I was stating correctly the column delimiter, but not the in field delimiter... because of this wrong translation. I say 'almost solved' because it does import the cvs with products, it´s Id´s, it´s categories and the images URLs, but it happens to make only the first image thumbs, the other 2 or 3 or any above the first image is added to the db, but seems not to make the thumbs? I also done the thm remake routine, still no joy here...
You can check it at www.lizzywhite.com/shop/index.php
Any advise to workaround this is appreciated
Thank you
You can check it at www.lizzywhite.com/shop/index.php
Any advise to workaround this is appreciated
Thank you
I am reporting this as a BUG, anyone having this behaviour should comment on it.
You can see screenshots, wich shows the behavior at this pdf I created: http://www.prestasho...er/download/235
The bug report is here: http://www.prestasho...cker/view/1707/
Any comments wellcome
You can see screenshots, wich shows the behavior at this pdf I created: http://www.prestasho...er/download/235
The bug report is here: http://www.prestasho...cker/view/1707/
Any comments wellcome
Ok, after having no feedback from anybody, not even team members, I got into a laarge coffee jar and NuSphere, and traced down what is going on... What happens here to be *failing* (for an unknown reason to me) is this function, wich is in /admin/tabs/adminimport.php aprox line 350:
What fails exactly is this if (@copy($url, $tmpfile)) , copying the image is failing for an unkown reason, therefore it skips too the imageresize routine...
If any team member can tell me why and moreover how to fix this, please?
Again, please note I have 2 servers, one IIS 5.2, the other is a Linux box, in both settings, same result... so I think it is not likely to a misconfiguration /permissions issue...
Please help as I am becoming a very frustrated zombie by now
Thank you
Thank you.
private static function copyImg($id_entity, $id_image = NULL, $url, $entity = 'products')
{
$tmpfile = tempnam("/tmp", "ps_import");
$img = array('tmp_name' => $tmpfile);
switch($entity)
{
default:
case 'products':
$path = _PS_PROD_IMG_DIR_.intval($id_entity).'-'.intval($id_image);
break;
case 'categories':
$path = _PS_CAT_IMG_DIR_.intval($id_entity);
break;
}
if (@copy($url, $tmpfile))
{
imageResize($img, $path.'.jpg');
$imagesTypes = ImageType::getImagesTypes($entity);
foreach ($imagesTypes AS $k => $imageType)
imageResize($img, $path.'-'.stripslashes($imageType['name']).'.jpg', $imageType['width'], $imageType['height']);
}
else
{
return false;
}
unlink($tmpfile);
return true;
}
What fails exactly is this if (@copy($url, $tmpfile)) , copying the image is failing for an unkown reason, therefore it skips too the imageresize routine...
If any team member can tell me why and moreover how to fix this, please?
Again, please note I have 2 servers, one IIS 5.2, the other is a Linux box, in both settings, same result... so I think it is not likely to a misconfiguration /permissions issue...
Please help as I am becoming a very frustrated zombie by now
Thank you
Thank you.
Have you checked other messages on the forum?
Maybe you have the same proble as this thread http://www.prestasho...mporting_images
Maybe you have the same proble as this thread http://www.prestasho...mporting_images
Helpful hints and tips to Empower your Prestashop site - Join us on Facebook and get involved, tell us the things that help you.
If you think someone's answer helped, please give him/her a Positive Reputation vote by liking their post.
E-commerce hosting from Scotserve, fast, reliable and affordable.
If you think someone's answer helped, please give him/her a Positive Reputation vote by liking their post.
E-commerce hosting from Scotserve, fast, reliable and affordable.
From 1239549606:
Have you checked other messages on the forum?
Maybe you have the same proble as this thread http://www.prestasho...mporting_images
Maybe you have the same proble as this thread http://www.prestasho...mporting_images
Thanks, I´ve read the thread, just to add, fopen is enabled in both servers; what I see when going step by step, stepping in into this procedure I mention is that uses tempnam function, wich behavior changed from PHP 4.x to PHP 5.X and it uses, in the case of Windows, the C:\windows\temp directory wich is an *absolute flaw* in terms of software desing; unless the SO temp folder has explicit permissions for IWAM_ and IUSR_, it will *fail* allowing writing in it... Since I dont know Linux, could be the same case?
In other things, I am amazed the thread you point states that URL´s should be within quotes (remarcs a.c.a " char) why? is that true? if so, if so... PS documentation SUCKS, if not... you guys have all the community guessing out how to doelementary things like importing a stupid CVS file...
Thank you
Hello all, first, sorry for my ranting here but, I think I am in fair right to being ranting!
First, I solved the issue, there where several thing causing it,
1. The so great 'tempnam' function is sooo... cheesy. returns whatever it comes around, sometimes the OS tmp dir, sometimes the USER tmp dir, that under Windows OS, in my production server I can´t see what happens, so the fix was changing this usage of tempnam to:
That ina ddtion to creating a CHMOD 600 folder named '_tmp' in the root dir of ps, and that helped with permissions and mystery paths at all
2. The so great PS documentation NEVER says the fields must be delimited by ", yes, the statement here http://www.prestasho...mporting_images
is soo correct and documentation is sooo lousy... 3 days to figure out it must be delimited
3. In the Image URL's field, curiously it says Image URL's (x, y, z) is sooo misleading that made me to put the URL´s that way, with a TRAILING SPACE BEFORE EACH OTHER like this http://one, http://two, http://three, etc and THIS TRAILING SPACE MAKES THE !copy($url, $tmpfile) to FAIL!
So be clear of these, NO TRAILING SPACES between URL´S or it will fail, USE DELIMITED FIELDS, e.g. "Name" instead of just Name in your CVS file.
Thank you for NOT DOCUMENTING as a result, 3 days of waste debugging....
First, I solved the issue, there where several thing causing it,
1. The so great 'tempnam' function is sooo... cheesy. returns whatever it comes around, sometimes the OS tmp dir, sometimes the USER tmp dir, that under Windows OS, in my production server I can´t see what happens, so the fix was changing this usage of tempnam to:
$var1=realpath($_SERVER['DOCUMENT_ROOT']).'\shop\_tmp';
$tmpfile = tempnam($var1, "ps_import");
That ina ddtion to creating a CHMOD 600 folder named '_tmp' in the root dir of ps, and that helped with permissions and mystery paths at all
2. The so great PS documentation NEVER says the fields must be delimited by ", yes, the statement here http://www.prestasho...mporting_images
is soo correct and documentation is sooo lousy... 3 days to figure out it must be delimited
3. In the Image URL's field, curiously it says Image URL's (x, y, z) is sooo misleading that made me to put the URL´s that way, with a TRAILING SPACE BEFORE EACH OTHER like this http://one, http://two, http://three, etc and THIS TRAILING SPACE MAKES THE !copy($url, $tmpfile) to FAIL!
So be clear of these, NO TRAILING SPACES between URL´S or it will fail, USE DELIMITED FIELDS, e.g. "Name" instead of just Name in your CVS file.
Thank you for NOT DOCUMENTING as a result, 3 days of waste debugging....
Hi there,
I am having the same issue and spent much more than 3 days and still not working:
It is a linux hosting and the hosting guys spent huge amount of time trying to figure our why importing products as csv does not import images with them.
I have tried all the different way of writing the image path (with "" and without), no good result.
Ok here is what i have reached so far:
-Alot of files are getting created in the /img/tmp (i.e. ps_importtH7o1j) with permission set to 600
-I cant change the permissions on those new files under the tmp folder, because they were created by the php script with and owner nobody. files are not generated there.
-the img/p folder is still empty, they
Questions: why is it creating them with owner nobody? can that be changed? otherwise the have permission 600
image import in really important for me to resolve as i have thousands of images and cant do that manually. please help
I am having the same issue and spent much more than 3 days and still not working:
It is a linux hosting and the hosting guys spent huge amount of time trying to figure our why importing products as csv does not import images with them.
I have tried all the different way of writing the image path (with "" and without), no good result.
Ok here is what i have reached so far:
-Alot of files are getting created in the /img/tmp (i.e. ps_importtH7o1j) with permission set to 600
-I cant change the permissions on those new files under the tmp folder, because they were created by the php script with and owner nobody. files are not generated there.
-the img/p folder is still empty, they
Questions: why is it creating them with owner nobody? can that be changed? otherwise the have permission 600
image import in really important for me to resolve as i have thousands of images and cant do that manually. please help
If we answered your question, please add [Solved] at the beginning of your topic’s title by editing your first post !
Thanks.
Thanks.
Quote
Hi there,
I am having the same issue and spent much more than 3 days and still not working:
It is a linux hosting and the hosting guys spent huge amount of time trying to figure our why importing products as csv does not import images with them.
I have tried all the different way of writing the image path (with “” and without), no good result.
Ok here is what i have reached so far:
-Alot of files are getting created in the /img/tmp (i.e. ps_importtH7o1j) with permission set to 600
-I cant change the permissions on those new files under the tmp folder, because they were created by the php script with and owner nobody. files are not generated there.
-the img/p folder is still empty, they
Questions: why is it creating them with owner nobody? can that be changed? otherwise the have permission 600
image import in really important for me to resolve as i have thousands of images and cant do that manually. please help
I am having the same issue and spent much more than 3 days and still not working:
It is a linux hosting and the hosting guys spent huge amount of time trying to figure our why importing products as csv does not import images with them.
I have tried all the different way of writing the image path (with “” and without), no good result.
Ok here is what i have reached so far:
-Alot of files are getting created in the /img/tmp (i.e. ps_importtH7o1j) with permission set to 600
-I cant change the permissions on those new files under the tmp folder, because they were created by the php script with and owner nobody. files are not generated there.
-the img/p folder is still empty, they
Questions: why is it creating them with owner nobody? can that be changed? otherwise the have permission 600
image import in really important for me to resolve as i have thousands of images and cant do that manually. please help
Hey first, read carefully my post, there is your solution!. All this mess is caused by the use of a function that returns temp folders, usually not granted to the web server or preprocessor identities, therefore copyimg fails consistently.
The solution is as follows:
Step 1. Make a new folder under the root folder where you installed, for me, that is /shop/, perhaps you installed under the root folder of your www publishing, in that case, in that same directory you create a folder and name it _tmp Then assing CHMOD (Permissions to 777)
Step 2. Download the file named adminimport.php, youll find it under your /admin/tabs/ folder. Once you download it, open it in notepad or similar and go to line 350 (aprox) you will find this function
private static function copyImg($id_entity, $id_image = NULL, $url, $entity = 'products')
{
$tmpfile = tempnam("/tmp", "ps_import");
$img = array('tmp_name' => $tmpfile);
switch($entity)
{
default:
case 'products':
$path = _PS_PROD_IMG_DIR_.intval($id_entity).'-'.intval($id_image);
break;
case 'categories':
$path = _PS_CAT_IMG_DIR_.intval($id_entity);
break;
}
if (@copy($url, $tmpfile))
{
imageResize($img, $path.'.jpg');
$imagesTypes = ImageType::getImagesTypes($entity);
foreach ($imagesTypes AS $k => $imageType)
imageResize($img, $path.'-'.stripslashes($imageType['name']).'.jpg', $imageType['width'], $imageType['height']);
}
else
{
return false;
}
unlink($tmpfile);
return true;
}
You may substitute that with this:
private static function copyImg($id_entity, $id_image = NULL, $url, $entity = 'products')
{
[b]$var1=realpath($_SERVER['DOCUMENT_ROOT']).'\shop\_tmp';[/b]
$tmpfile = tempnam($var1, "ps_import");
$img = array('tmp_name' => $tmpfile);
switch($entity)
{
default:
case 'products':
$path = _PS_PROD_IMG_DIR_.intval($id_entity).'-'.intval($id_image);
break;
case 'categories':
$path = _PS_CAT_IMG_DIR_.intval($id_entity);
break;
}
if (@copy($url, $tmpfile))
{
imageResize($img, $path.'.jpg');
$imagesTypes = ImageType::getImagesTypes($entity);
foreach ($imagesTypes AS $k => $imageType)
imageResize($img, $path.'-'.stripslashes($imageType['name']).'.jpg', $imageType['width'], $imageType['height']);
}
else
{
unlink($tmpfile);
return false;
}
unlink($tmpfile);
return true;
}
Noteh the line in bold, you have to substitute \shop\ to \yourrootfoldername\ in case you installed on other than hosting root, if installed on hosting root, just do \_tmp This will benefit as follows:
1. No more use of OS tmp folder or mistery ungranted folder at all, at least for importing images
2. Correct unlink of a tmpfilename that otherwise (original code) was remaining in mistery tmp folder, causing build up.
This worked for me, it was not easy to fix it, and beleive me, PS members are willing to hep but they are overloaded and theye are not going to fix your problem, so fix it yourself
Hope this helps
Please note that I have linux hosting and yes i have prestashop right on the www/ (not inside another folder). you made it soo clear to understand, thank you soo much. I will try your solution now and report back.
If we answered your question, please add [Solved] at the beginning of your topic’s title by editing your first post !
Thanks.
Thanks.
I am getting this error after the change when i go to the import tab
Parse error: syntax error, unexpected '[' in /public_html/admin123/tabs/AdminImport.php on line 386
That is what i have in my file now:
Parse error: syntax error, unexpected '[' in /public_html/admin123/tabs/AdminImport.php on line 386
That is what i have in my file now:
private static function copyImg($id_entity, $id_image = NULL, $url, $entity = 'products')
{
[b]$var1=realpath($_SERVER['DOCUMENT_ROOT']).'\_tmp';[/b]
$tmpfile = tempnam($var1, "ps_import");
$img = array('tmp_name' => $tmpfile);
switch($entity)
{
default:
case 'products':
$path = _PS_PROD_IMG_DIR_.intval($id_entity).'-'.intval($id_image);
break;
case 'categories':
$path = _PS_CAT_IMG_DIR_.intval($id_entity);
break;
}
if (@copy($url, $tmpfile))
{
imageResize($img, $path.'.jpg');
$imagesTypes = ImageType::getImagesTypes($entity);
foreach ($imagesTypes AS $k => $imageType)
imageResize($img, $path.'-'.stripslashes($imageType['name']).'.jpg', $imageType['width'], $imageType['height']);
}
else
{
unlink($tmpfile);
return false;
}
unlink($tmpfile);
return true;
}
If we answered your question, please add [Solved] at the beginning of your topic’s title by editing your first post !
Thanks.
Thanks.
Are you sure that this should work on Linux?
If we answered your question, please add [Solved] at the beginning of your topic’s title by editing your first post !
Thanks.
Thanks.
That's because I used a bold tag inside of the code tag in the post!
here is exactly what you need, copy again, copy this:
That, as is, no changes, copy it and replace the entire function, and give it a try, It should work now!
here is exactly what you need, copy again, copy this:
private static function copyImg($id_entity, $id_image = NULL, $url, $entity = 'products')
{
$var1=realpath($_SERVER['DOCUMENT_ROOT']).'\_tmp';
$tmpfile = tempnam($var1, "ps_import");
$img = array('tmp_name' => $tmpfile);
switch($entity)
{
default:
case 'products':
$path = _PS_PROD_IMG_DIR_.intval($id_entity).'-'.intval($id_image);
break;
case 'categories':
$path = _PS_CAT_IMG_DIR_.intval($id_entity);
break;
}
if (@copy($url, $tmpfile))
{
imageResize($img, $path.'.jpg');
$imagesTypes = ImageType::getImagesTypes($entity);
foreach ($imagesTypes AS $k => $imageType)
imageResize($img, $path.'-'.stripslashes($imageType['name']).'.jpg', $imageType['width'], $imageType['height']);
}
else
{
unlink($tmpfile);
return false;
}
unlink($tmpfile);
return true;
}
That, as is, no changes, copy it and replace the entire function, and give it a try, It should work now!




Back to top








