Jump to content

csv import


Recommended Posts

I installed version 1.5.3.1. I did import categories. The character € (euro) is a problem. In UTF-* the categorie si not copies. In ISO the categorie is copied but the character is a square-sign.

 

Another problem is that you can import an image url. This is not working and I can't find how to slove this. Do I have to upload the images first and whereto? And how does the url looks like?

 

Anu suggestions.

Link to comment
Share on other sites

Sorry, but do you really want me to understand the solution given in the link? The categorie CSV import offers the possibility of an image url. I just want to know how that works. The same for the euro character. See my questions above.

 

I am new to prestashop, so I hope to find things in documentation or substitutes of it.

 

Thanjs again for any auggestions.

Link to comment
Share on other sites

  • 2 weeks later...

Hello Noudshoorn

Seems to be a bug with 1.5.3.1 regarding image uploads. Here is the fix. Take your time and double check you typing!

 

This is for version 1.5.3.1

Take your time and BE CAREFUL!

 

1. Navigate to controllers/admin/AdminImportController.php

2. Make/Save a copy of AdminImportController.php - just in case you need to resurrect it.

3. Open AdminImportController.php with a suitable application (Notepad, Dreamweaver, whatever...)

4. Scroll down to line (approx) 645 you are looking for the following lines to delete:

 

645 do $uniqid = uniqid(); while (file_exists(_PS_UPLOAD_DIR_.$uniqid));

 

646 $tmp_file = file_put_contents(_PS_UPLOAD_DIR_.$uniqid, $field);

 

647 $fd = fopen($temp, 'r');

 

5. Delete the 3-lines above (the lines are important to delete - the line numbers in case your numbers differ slightly)

6. Add the following lines in their place:

 

645 do $uniqid_path = _PS_UPLOAD_DIR_.uniqid(); while (file_exists($uniqid_path));

 

646 file_put_contents($uniqid_path, $field);

 

647 $fd = fopen($uniqid_path, 'r');

 

7. Delete the following line which is just a line or two down - apprx 650

 

650 unlink($tmp_file);

 

8. Replace it with:

 

650 unlink($uniqid_path);

 

9. Save the file - your images will now upload

Link to comment
Share on other sites

This is the solution for the product images that refuse to upload using the csv product import routine for your csv files.

If you have a product csv upload file that contains image URLs this will enable them load when you use the product import function.

 

The csv product import function seems to be written to only create a new category and put the product(s) in it. Seems as though if the category already exists, it won't put the product in it. Seems dumb to me. I haven't cracked the fix for this yet.

 

I'm planning on looking at the manufacturer issue also s soon as I get back to the states - currently in Paris - headed back tomorrow.

Link to comment
Share on other sites

Thanks KenSTJ. Hope you find the solution. I have a suggestion. In the Netherlands we have a advice selling price from the manufactorer. And the retailer has his own price. Is it possible to import the retailor price as the product price in specific prices?

Link to comment
Share on other sites

i have a problem trying to import my products, when i put my csv and wait for a while send this error:

 

Service Unavailable

 

The service is temporarily unavailable. Please try again later.

 

i have no idea why =(

im using 1.5.3

Does the csv file get uploaded to the server (are you able to see it in the file drop down box)?

 

If NO - upload it to your admin/import folder directly using FTP - then it will appear for you to select. The files that appear in this box are the ones in that folder - adding to the folder makes them appear - deleting them from the folder removes them from the drop down box.

 

if YES - then it sounds like a processing issue on the server side. When you click "Import csv" data" processes run on the server within Prestashop to add the products and their properties. I note on my system that it takes a long time to process even one product. It sounds like something is waiting for the process to happen but decides that it can no longer wait (times out). Once its wait time is done, it sends the error message. I am guessing you're on a shared server - if that's true it may be too busy to handle the request. I think your next step is to get with the hosting company and discuss the issue.

Link to comment
Share on other sites

Thanks KenSTJ. Hope you find the solution. I have a suggestion. In the Netherlands we have a advice selling price from the manufactorer. And the retailer has his own price. Is it possible to import the retailor price as the product price in specific prices?

If I understand the question - you want to import the retail price into the product price?

 

If YES - after importing the csv, just find the column that is showing the retail price and select:

Price tax excl. or Price tax incl

if NO - sorry I am not understanding the question - please try again - I apologize that you have to use English and that I cannot speak Dutch

Link to comment
Share on other sites

Don't bother about the language. Its NO. In the product you can enter a product price and specific prices (discounts). There you can give a discount. There too you can enter a different product price. And there I want to enter the retail price. Hope this explanation is clear, otherwise we try again.

Link to comment
Share on other sites

Does the csv file get uploaded to the server (are you able to see it in the file drop down box)?

 

If NO - upload it to your admin/import folder directly using FTP - then it will appear for you to select. The files that appear in this box are the ones in that folder - adding to the folder makes them appear - deleting them from the folder removes them from the drop down box.

 

if YES - then it sounds like a processing issue on the server side. When you click "Import csv" data" processes run on the server within Prestashop to add the products and their properties. I note on my system that it takes a long time to process even one product. It sounds like something is waiting for the process to happen but decides that it can no longer wait (times out). Once its wait time is done, it sends the error message. I am guessing you're on a shared server - if that's true it may be too busy to handle the request. I think your next step is to get with the hosting company and discuss the issue.

 

hey thanks for answere, tell you what happend:

1.- upload the CSV file into the server

2.- map the fields to upload

3.- click import, after about 30 sec. the error comes out

 

thats very funny cause i try to upload the file several times, but they dont appear in the product list, just yesterday i foun all the items in my main category,

 

i guess its a server problem, let you know if i found the answere

 

thanks alot

Link to comment
Share on other sites

This is the solution for the product images that refuse to upload using the csv product import routine for your csv files.

If you have a product csv upload file that contains image URLs this will enable them load when you use the product import function.

 

The csv product import function seems to be written to only create a new category and put the product(s) in it. Seems as though if the category already exists, it won't put the product in it. Seems dumb to me. I haven't cracked the fix for this yet.

 

I'm planning on looking at the manufacturer issue also s soon as I get back to the states - currently in Paris - headed back tomorrow.

Hi Ken. How are you doing with this problem?

Link to comment
Share on other sites

Hello Noudshoorn

For some reason I have not been able to recreate the problem - perhaps it has been corrected. In any case, I reloaded 1000 or so products and all manufacturers were created as expected. Have you solved your issue yet?

Link to comment
Share on other sites

This is my problem an d not only my problem. First I import the categories. Then I import the manufactorers. And then the products. These are giving problems. The products are not linked to the already imported categories and subcatagories. The products are not linked to the already imported manufactorors, And finally the images of the products are not imported. Importing of combinations what we have a lot we did not even get the oppertunity to do that. So what problems can we expect there. It looks like things are made operational without a test.

 

First several people recommended me prestashop instead of magento. Next looking at the prestashop site and reading about it made me very enthousiastic. But now, after 4 weeks of stumbling with te first and most important part to startup our webshop in a new coat we are loosing patience. Importing is not working.

 

And

the forum doesn't work in IE.

Link to comment
Share on other sites

By the way - I felt the same way you are feeling now about PrestaShop when I first started. This is mostly due because it's hard to find any help documentation. Note that what I mean is that the help is there but it is hard to find. I struggled thru the CSV upload process but, once I figured it out it works just fine. The explanations and some of the upload module's interface is very confusing and not very intuitive(helpful) to those without a programming background.

 

My advice is - stick with it and I will help as much as possible to get you thru this. My shop is running fine so I know 5.3.1 works just fine - if you can get over the learning curve. It shouldn't be that way but, it is. Now that I have "mastered" the CSV import I am sure we can get thru this together so don't give up!

Link to comment
Share on other sites

Hi guys, I have been using prestashop for awhile but I'm STILL struggling to figure out how the import of csv files work.

 

I am fine doing the import of Categories and products to a certain extent.

 

can someone please explain to me how to import a product that needs to be assigned/associated to multiple categories?

 

1. do I assign the "categories (x,y,z)" tab to the column i want to import?

 

does this tell prestashop to which categories the product must be associated with?

 

2. in my csv file, what do i need to use as "categories (x,y,z)?

 

do i need to use the html of the category its associated with? or do i just use the categories name? or do I use the re-written category name? as an example: http://www.yankeecandle.com/3-candles.html versus "candles" versus "3-candles"?

 

as you can imagine I'm stumped what to do.

 

also how do I assign the product images to these products? in the csv import it asks for the image url? but how do i know what the image url is if i haven't uploaded it yet? or how do I do this? and then assign it to a product?

 

or do I need to upload the image via ftp to my prestashop installation and then get a url or something from my server?

 

Please help as I can't figure out how to do it and the help guides from Prestashop AREN'T helpful at all!!!

 

Thank you

Link to comment
Share on other sites

Hello I_raath

 

Note I am using PS ver 1.5.3.1

 

The Import function in Catalog/Products stores the file containing your products, categories, image urls, etc., into the import folder located inside the admin folder which is stored on your server. The processing of the file begins when you select the file using the drop down box, make selections using the various drop down boxes and fields below it, and pressing "Next".

 

With respect to getting the file stored into the import folder, you can either use the "Upload" button and search for the file to upload on your computer, or you can put the file into the admin/import directly using FTP.

 

The drop down box where you select the file to use is really a list of all the files stored in the import folder. Deleting a file from the folder deletes it from the drop down box list.

 

The file itself is a series of text statements separated by some special character (the "delimiter") such as a comma, pipe (|), semicolon, etc - it doesn't really matter except that the character should be something that is not the same as a char which is found in the text statements.

For example, if your text contains a semicolon as part of html or other code, then obviously you shouldn't use the semicolon as your delimiter since the one that is part of the text would be interpreted as a separator and would split the text into multiple parts instead of all together.

I recommend the pipe symbol as it is rarely used in text statements.

 

The upload part of the process doesn't really care what's in the file - it's job is just to store the file on the server for processing.

 

After selecting the file to use, making changes to the parameters below the drop down box, and hitting next, you are presented with a list of the text statements which are separated by the controller using the delimiter character you are using.

 

Also at the top of the list are the available definitions you can choose to tell PrestaShop what the data represents. These available definitions change depending on what you have selected as the "Type of entity you wish to import".

 

You can see the various definitions at the extreme right side of the import screen which correspond to the type of entity you're trying to import.

 

Here is, I think, the key to understanding how your data should be organized:

1. ALL data should be separated by the delimiter character. Relative to your question regarding categories, this means if you have a category and sub categories, each one is separated by the delimiter. Example; for candles/large/aromatic in the text file you would have candles | large | aromatic or candles;large;aromatic, etc.. When you hit "Next" the processor would put each of these in a separate column and you would define candles as category, large as subcategory, etc., using the drop down box for each column.

 

2. Note that it makes no difference where these terms are located in the text string because the processor's job is just to separate them out into a list - each one having it's own drop down box to tell PrestaShop what it's supposed to be. This means the text file doesn't have to be arranged in some order - it just has to contain all of the data you want to use. So, you could have a file like this: ID|candles|Yankee Candle|large|this is a really great candle|aromatic and still be able to define each text statement as what it should be using the drop down box above it in each column.

 

3. It is not necessary to import categories first, then manufacturers, then products, etc. You can do it all at once. When selecting what type of entity you are importing using the drop down box, pick one and look at the available fields on the right side of the page. These tell you what selections are going to be available in the drop down boxes at the top of each column when you hit "next". All you have to do is put the data in the text file that will correspond to these fields in order for it to be put into your shop. In 1.5.3.1 if you put a category in your text file that doesn't exist, it will be created. This is the same for subcategories, manufacturers, etc. So there's no real need to upload categories or manufacturers ahead of the product uploads. You can put the products and the manufacturers and the categories and the subcategories all in the same text file and upload all at once.

 

4. Regarding images, the URL must link to a file that is stored on "a server" somewhere. In my my case, I get a datafeed from a supplier that contains a link to an image on his server. In the text file he sends me there's one field entry like this:http://www.supplier.com/images/product254.jpg. When I upload the file and process it, this URL appears in the list and I use the drop down box to define it as an Image for the product.

 

You can upload an image from your computer ahead of time if you want by creating an image folder on your server and putting your image into it using FTP. Then, in your text file, you would put a statement that was the full URL to that image:http://www.myshop.com/images/productimage256.jpg.

 

There is a routine in catalog/products which allows you to associate an image from your computer to a product individually. Once you select a particular product you can upload using the "images" selection in the left column. This will take the image from your computer and put it into the img folder in the root of your shop on the server. However, I don't recommend fooling with this folder yourself trying to put images into it. Either FTP the images into an image file you create and put the url into the text file upload or use the individual images selector in catalog/products and let PS figure out where it goes.

 

Clear??

Edited by KenSTJ (see edit history)
  • Like 1
Link to comment
Share on other sites

Howzit KenSTJ...

I am also using 1.5.3.1

 

Thanks for the full on description of csv import... and I do understand that completely... however the issue is not "how to do a csv" import but do I use "category names" or "category id's" under the "category (x,y,z)" column?

 

when I import the image urls in csv:

 

1. the images don't show

2. if i manually upload an image to a category or a product i get a server redirect that looks like this:

yankee-candle.co.za %29%28[0-9]%29%28[0-9]%29%28[0-9]%29%28[0-9]%29%28[0-9]%29%28[0-9]%29%28[0-9]%29%28-[_a-zA-Z0-9-]*%29?%28-[0-9]+%29?/.+.jpg"]/([0-9])([0-9])([0-9

])([0-9])([0-9])([0-

9])([0-9])([0-9])(-[

_a-zA-Z0-9-]*)?(-[0-

9]+)?/.+.jpg %{ENV:REWRITEBASE}im

g/p/$1/$2/$3/$4/$5/$

6/$7/$8/$1$2$3$4$5$6

$7$8$9$10.jpg temporary

 

and that is for each and every image that i upload so there are pages and pages of redirects. this prevents me from running SEO tools.

 

I saw there was an update to the adminimportcontroller.php and i copied the code as it said there is an issue, but i am still having the same problem.

 

Does this make sense?

Link to comment
Share on other sites

Hello

 

You use the name of the category or subcategory - candles - or - matches - or - wicks - or - whatever. It's the same text that would appear on the home page menu selections.

 

When you say you "manually uploaded" an image was that via FTP?

Link to comment
Share on other sites

  • 1 month later...

Hi, I have been working through CSV importer issues and I have a couple of questions:

1- If you're importing a product into multiple categories (main, subcategory tier 1, subcat tier 2), can you use the same subcategory name for different products?

 

Ex: Main level of category: Pennies, Nickels Dimes

Subcategory- 1950, 1951, 1952

Second Subcategory- Devner mint, San Fransisco mint, Philadelphia mint

 

Instructions say the importer will not work with multiple categories with the same name, but is that true of subcategories when the main category is different?

 

Like this this (penny, 1952, denver mint), (nickel, 1952, denver mint)

 

Sort of a confusing question. I saw someone asking the same thing about clothing, but no one answered him. Anyone's experience with this would be helpful.

 

Also, though I did get the image importer to work in the past, I am not now. I'm not sure if it is the bug in the AdminImportController file or what. I replaced it already with a 'fixed' version so that the products would go into categories other than home.

 

Just to retry/ double check what I've been doing with FTP, where should I be putting a file of images? Should they go in the uploads folder of the public section, just in a new file you create in the public section, or in the import file of admin?

 

I thought the last time I got it to work I made an imgimport folder in public_html and it worked fine.

 

Any thoughts, because I don't want to unnecessarily mess with the AdminImportController file.

 

Thank you in advance!

Link to comment
Share on other sites

  • 7 months later...

Hello,

I'm using 1.5.6.1 version of Prestashop and since now I have imported successfully many csv product files, but this time I'm struggling with "Price tax included" .

I select in import window "Price Tax included" to the column which contains this prices, but after import this column is imported in "Pre-tax retail price".

 

Anyone have this issue?

 

Thank you.

Link to comment
Share on other sites

×
×
  • Create New...