pdol Posted February 12, 2009 Share Posted February 12, 2009 I have been searching all over this forum and cannot seem to find the proper way to import images during the product import. I can get all other parts of the import process to work but the images never show up. What is supposed to be happening during the import process with the images?Are they being copied from the URL that I supply in the import file to a sub directory in /img? Or is the URL provided in the import file where I want the images to reside? Are there specific permissions that I might be missing on some dir? I have CHMOD /img & subs and /uploads to 777. Any help would be appreciated Link to comment Share on other sites More sharing options...
prestabase Posted February 12, 2009 Share Posted February 12, 2009 pdol,I believe the images column in your spreadsheet should be the actual URL where your product images reside. So first, you would upload all of your product images to a directory of your choice (i.e. prestashop/prod_images). Then within your spreadsheet you would fill in the images column, for each product. (i.e. http://yourdomain/prestashop/prod_images/1234.jpg)Here's a great tool when using spreadsheets to manage your inventory. http://www.digdb.com Link to comment Share on other sites More sharing options...
pdol Posted February 12, 2009 Author Share Posted February 12, 2009 I have tried it the way you suggest and it doesn't display the image. Could some verify what the image url field in the import is for? The absolute path to the images or an interim location from where images are copied to another directory.thanks Link to comment Share on other sites More sharing options...
jhnstcks Posted February 12, 2009 Share Posted February 12, 2009 You need to add the full URL where the image is located, and also add an product id field to your csv, other wise the software doesnt link the product to the image.http://www.prestashop.com/forums/viewthread/10586/general_discussion/can_some_one_please_post_how_they_managed_to_get_the_import_to_work_will_pay_for_help_if_need_behttp://www.prestashop.com/forums/viewthread/10511/installation_configuration___upgrade/importing_via_cvs_product_with_multiple_images_dot_http://www.prestashop.com/forums/viewthread/11812/general_discussion/setting_up_csv_dot__for_import_will_pay_to_have_fixedhttp://www.prestashop.com/forums/search_results/f6ceb2bd5552f1b9b5f6e5bce8a830c7/P20/ Link to comment Share on other sites More sharing options...
pdol Posted February 13, 2009 Author Share Posted February 13, 2009 There must be more to what is happening. I have tried the way you suggest and it still doesn't work. When I look to see what image it is trying to display, it shows something like: /img/p/16-16-large.jpg. Here is what I did to test:1. placed an image file in /img/tmp called file.jpg2. ran the import using the proper format and in image URLs field place the full URL to the image file in /img/tmp/3. no errors on import4. checking the properties of the image file on the product it says /img/p/16-16-large.jpgSo is it copying/converting the file to another name. Is this by design and if so why are these files not placed into the /img/p/ directory after the import process completes. Even if I place the files myself into /img/p/ the product image refers to a different name. Something along the lines of 16-16.jpg. This I assume is the the id number followed something else. Can someone please explaing what is supposed to be happening?Is this basically it?reads import file > copies image from URL in import file to another image file & places it in /img/p > Link to comment Share on other sites More sharing options...
Right-On Posted February 13, 2009 Share Posted February 13, 2009 Heve you tried to regenerate thumbnails after import?BACKOFFICE > PREFERENCES > IMAGE > REGENERATE THUMBNAILS I am asking you because I am just a little behind you, I am in the process to import products .CSV.Good luck!Alfredo Link to comment Share on other sites More sharing options...
Gregory Roussac Posted February 13, 2009 Share Posted February 13, 2009 also add an product id field to your csv Yep ! This bug has been corrected for next release. Until then this is required. Link to comment Share on other sites More sharing options...
Gregory Roussac Posted February 13, 2009 Share Posted February 13, 2009 reads import file > copies image from URL in import file to another image file & places it in /img/p > Yes !Have you tried specifying a ID for each line in your csv ? Link to comment Share on other sites More sharing options...
Dr. Benway Posted February 13, 2009 Share Posted February 13, 2009 Waiting for the next release, I patched the bug in this way and it works fine:1) AdminImport.php ( folder /youradminfolder/tabs/ ) : add after line 477 (just after the array_walk instruction)// if ID from csv is missing or not a number, generate a new ID from product tableif (intval($product->id)==0) $product->id = $product->getHighestIdProduct() + 1;2) Add this function to Product.php (in /classes/ ) : add the following functionpublic function getHighestIdProduct(){$result = Db::getInstance()->getRow(’SELECT MAX AS maxIdFROM ‘.DB_PREFIX.‘product’);return $result[‘maxId’];}Now you can omit the id into csv file and images will have correct id to join the relative product. Link to comment Share on other sites More sharing options...
rossdavidh Posted February 17, 2009 Share Posted February 17, 2009 Dr. Benway I appreciate your posting a solution, but when I tried this it appeared to have broken my Import entirely (no error message, it just never finished). But maybe it is not your code per se but an interaction, as I had also tried the code fix suggested in:http://www.prestashop.com/bug_tracker/view/749/Regardless of whether I use either code modification or not, or whether I have a column for ID or not, I do not successfully retrieve the images. Am I supposed to be able to use a URL from another site, for example my current (oscommerce) website? Or does it have to be a relative URL, from within the prestashop site? If it has to be from within the prestashop directory, does it matter where I put it?If someone who has successfully imported images could post a few rows from their csv, that might help to clear up confusion, and not only for me. Link to comment Share on other sites More sharing options...
Dr. Benway Posted February 17, 2009 Share Posted February 17, 2009 the field URL in csv file really is not an url but an absolute path on your machine! e.g. c:\imagetoupload\ Link to comment Share on other sites More sharing options...
rossdavidh Posted February 18, 2009 Share Posted February 18, 2009 Oh. My. God. It worked! Thank you so much! Link to comment Share on other sites More sharing options...
Dr. Benway Posted February 18, 2009 Share Posted February 18, 2009 Yes, it works ;-) Link to comment Share on other sites More sharing options...
pdol Posted February 18, 2009 Author Share Posted February 18, 2009 Dr. Benway, You are saying that it will import the image files from my local pc to the web server? It doesn't seem to work and I have done all the steps. Please help.-thanks Link to comment Share on other sites More sharing options...
Dr. Benway Posted February 18, 2009 Share Posted February 18, 2009 Im only saying that it works for me ;-)If your problem on import is the correct link between product and image, my patch works ... but u could have other problems related, i dont know Link to comment Share on other sites More sharing options...
evilopinions Posted March 29, 2009 Share Posted March 29, 2009 Hey PDOlNot sure if your problem is solved but here is what I have done.I have uploaded all the images to a directory and then given absolute url to the image dir : http://xuz.com.au/img/products/image001.jpgIt will auto create home,large,medium,small,thickbox and normal image per image. This will be auto generated in the P folder inside img folder. So your imported products will show on site from img/p/Here is a sample CSV for consideration samplepresta.csv Link to comment Share on other sites More sharing options...
Rockinbill Posted April 6, 2009 Share Posted April 6, 2009 To Evilopinion : I have uploaded all the images to a directory and then given absolute url to the image dir : http://xuz.com.au/img/products/image001.jpgIt will auto create home,large,medium,small,thickbox and normal image per image. This will be auto generated in the P folder inside img folder. So your imported products will show on site from img/p/ Did you tested on your local machine or on a mutual server ?Did you tested it with upper CSV files ?For me this works only for CSV files containing less than 9 items (9 lines) ... Bill Link to comment Share on other sites More sharing options...
evilopinions Posted April 6, 2009 Share Posted April 6, 2009 To Evilopinion : I have uploaded all the images to a directory and then given absolute url to the image dir : http://xuz.com.au/img/products/image001.jpgIt will auto create home,large,medium,small,thickbox and normal image per image. This will be auto generated in the P folder inside img folder. So your imported products will show on site from img/p/ Did you tested on your local machine or on a mutual server ?Did you tested it with upper CSV files ?For me this works only for CSV files containing less than 9 items (9 lines) ... Bill Hi Bill,I tested mine on both local and remote server.I remember having a similiar issue of pnly 8 or 11 lines being imported..If I renmember correctly it had something to do with reserved words..Upload your csv and let me have a look and hopefully i can point things out.Did you check that all your product names do not have some reserved words..Just do a quick search in here and see the words that are not allowed in your csv Link to comment Share on other sites More sharing options...
Rockinbill Posted April 6, 2009 Share Posted April 6, 2009 I remember having a similiar issue of pnly 8 or 11 lines being imported..If I renmember correctly it had something to do with reserved words..Upload your csv and let me have a look and hopefully i can point things out.Did you check that all your product names do not have some reserved words..Just do a quick search in here and see the words that are not allowed in your csv Thanks for offering some help, my items are correctly uploaded and not with reserved words, but my problem is about images when uploading large CSV files. With upto 8 items my images are correctly displayed. Link to comment Share on other sites More sharing options...
evilopinions Posted April 6, 2009 Share Posted April 6, 2009 Did u check that the image extensions is same for both? You may have put .png in your csv but actually uploaded jpg to your server for import from the 9th line onwards.. Link to comment Share on other sites More sharing options...
first1 Posted April 13, 2009 Share Posted April 13, 2009 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, theyQuestions: why is it creating them with owner nobody? can that be changed? otherwise the have permission 600image import in really important for me to resolve as i have thousands of images and cant do that manually. please help Link to comment Share on other sites More sharing options...
dandumit Posted September 21, 2009 Share Posted September 21, 2009 the trick with product_id worked for me in version 1.1 unfortunately this it's a very nasty solution :Ex :- if you specify an existing ID - the import functionality will import two products with the same ID. I think that the product_id should be a primary keyIt is a bad functionality when products already exists in database !It seems that in version 1.2.3 -or maybe later has been fixed. Link to comment Share on other sites More sharing options...
first1 Posted September 21, 2009 Share Posted September 21, 2009 Hi dandumit,What you stated is totally right, that was fixed in later versions.I use the product_id always, so I was never affected by that... My issue above was resolved by moving to another hosting... it was my hosting that had file ownership conflict between php and httpd. Link to comment Share on other sites More sharing options...
Vedro Posted September 29, 2009 Share Posted September 29, 2009 I'm having a tough time with the images too.Have read all of the posts.Question: In which table are these absolute URL references stored?I'm uploading the CSV using the tool with no problem...all the product is there, but the images are not showing up.So I started trying to locate the underlying table in MySql...searching all over.Thanks,Ben Link to comment Share on other sites More sharing options...
daster Posted December 22, 2009 Share Posted December 22, 2009 I am having this problem as well. Have not found a solution yet, and its killing me. I am determined to use prestashop, but i am short of losing it. my csv imported fine. products are in, im trying to figure out how to setup categories as well. but my main goal is IMAGES! Link to comment Share on other sites More sharing options...
Federico Gomez Posted February 11, 2010 Share Posted February 11, 2010 I have the same problem. I import CSV file of products but the images doesn´t show. in the url image column on the CSV what should i write? Link to comment Share on other sites More sharing options...
LittleLou Posted July 4, 2010 Share Posted July 4, 2010 Waiting for the next release, I patched the bug in this way and it works fine:1) AdminImport.php ( folder /youradminfolder/tabs/ ) : add after line 477 (just after the array_walk instruction)// if ID from csv is missing or not a number, generate a new ID from product tableif (intval($product->id)==0) $product->id = $product->getHighestIdProduct() + 1;2) Add this function to Product.php (in /classes/ ) : add the following functionpublic function getHighestIdProduct(){$result = Db::getInstance()->getRow(’SELECT MAX AS maxIdFROM ‘.DB_PREFIX.‘product’);return $result[‘maxId’];}Now you can omit the id into csv file and images will have correct id to join the relative product. I have now tried to make these changes, and it as seriously damaged my shop and I was just about to launch - can someone help me get it back to normal. My frontend is blank, backend works fine. I have uploaded the standard files again - AdminImport.php to my admin/tab folder and product.php to my classes folder. PLEASE! I need some good support. Kind regards, A. Lou.www.blaek-toner.dk/prestashop Link to comment Share on other sites More sharing options...
Timothy Jarman Posted July 6, 2010 Share Posted July 6, 2010 i recently just had this problem, im not sure if this helps you guys but it worked for me, i changed changed PHP Safe mode to Off Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now