Jump to content

Product CSV import not adding categories of product


Recommended Posts

Hi,

 

FYI: i'm using the latest PS version: 1.6.0.9

 

I've been trying to import products via a csv file but i'm running into a problem that i can not figure out.

I based it on the sample csv from the PS admin panel.

 

First, i realised that if i add the categories of my product as text/word, PS creates a new category for each one. So i replaced the categories by the ID of the categories i want a product to be assigned to.

 

And it seems to work as i see all my products in the PS admin panel. But my only problem is that only the first product of the csv file get assigned to the correct categories. All others are actually missing the categories data. So when i look on the front store, i do not see them since they are not assigned in PS.

 

I attached the sample i'm using for my test as a reference.

 

Any help would be greatly appreciated as i've been searching around the net for an answer but could not find any. I would really like to avoid importing all my product manually. It would be such as waste of time. Especially when there is an import feature.

 

I just hope, i'm missing something stupid and that some one had that problem already.

 

Cheers

 

TEST-IMPORT-Products.txt

Link to comment
Share on other sites

I have some suggestions:

 

1. You don't have to use all the columns in the standard CSV template, if you don't need them. If I were you, I would get rid of all the columns I don't need and also those that would be filled up with the default values (for example, you don't need the "On Sale" column if all the values would be 0, because that's the default)

2. Use the semicolon character as column separator, both in your CSV and in PS options upon import

3. Use a UTF8 encoding, both in your CSV and in PS options upon import

4. I imagine you are using a spreadsheet application to edit your CSV and save/update for any changes. I have found that the OpenOffice/LibreOffice Calc application gives more compatible results when exporting/saving to CSV, compared to Microsoft Excel

 

Based upon the above suggestions, I have edited your CSV. Try it and tell me if it works:

 

 

.

TEST-IMPORT-Products-edited.txt

Link to comment
Share on other sites

Hi parsifal,

 

thank you very much for your reply with explanation and for even worked on my file.

 

I've tried and your file does not work. it creates errors such as:

Property Manufacturer->name length (84) must be between 0 and 64

or

Property Product->reference length (254) must be between 0 and 32.

it looks like it's jumping a column or something.

 

But with the info and suggestion you gave me, i will try other alternative for my file structure and hopefully find a solution. 

I hate when the machine beats me. I need to find the solution. Failing at something that should be as simple and straightforward will hunt me for a long time !! lol :)

 

Thanks again

Link to comment
Share on other sites

That's strange. I reopened the CSV in OpenOffice Calc and it is correctly delimited.

 

Did you notice that I changed the delimiting character from comma ',' to semicolon ';' ? You should select the related option in PrestaShop import page, like I indicated in point 2 of my first post.

 

And also check PrestaShop's preview, where it tries to guess which CSV column is which. It may guess incorrectly sometimes (that is why I always use my own CSV template and load it from the CSV preview screen)...

Edited by parsifal (see edit history)
Link to comment
Share on other sites

yes i made sure about the "," and ";" and "" for multiple values.

I even tried different combination than yours. 

I added the column of "URL rewrite" to even eliminate the warning after the import.

 

I must say that some of the issue i previously had was my fault as i did not match/assigned some columns. When too fast and i've been working too long on this.

So i finally get an import file that had no errors or warning after hitting the "import button". I even rebuilt the search index as suggested even though it should have nothing to do with it.  Yet only my first product has categories selected. All other product have nothing saved.

If i edit one and just click the save button, i get the message that it needs to have a category selected. Very strange.

Link to comment
Share on other sites

  • 2 months later...

I have the same problem. I've imported 93 products, and i can see only 90 products in my shop.

In the backoffice i can see all the 93 products, I looked manually, and found the 3 products, and they dont have assigned any category. But in the csv file they have a category...

I dont know what is this error, i've looked in phpmyadmin, in the sql query there are only 90 products in the ps_category_product table. 

 

It wish i could select all products in the backoffice and assign a category to all.

 

 

Someone practiced please help us solve this problem, its very frustrating...

Edited by Mecs (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...