Jump to content

[Tutorial] on how to import categories and sub-categories with CSV


Recommended Posts

Actually I found the answer :)

For the subcategories, just follow Star tutorial and filed "Parent Category" in the excel file (anywhere you want) and put the name of the... parent category in there. The imported data will be automatically affected to the corresponding parent category!

EASYYYYYYYY :)

  • Like 1
Link to comment
Share on other sites

I just add the tutorial on how to import sub-categoies with CSV. Please see the first post.

About importing the products, you need to set up the all of the categories and sub-categories, suppliers, manufacturers, and attributes first. Then follow the how to set up sub-categories with CSV, match up all of the columns, and import, that is it... Good luck to you.

Link to comment
Share on other sites

  • 1 month later...

Nice doc! Thanks!

Works fine with me. It imports the main categories and the subcategories. But what about the subsubcategories? One level deeper? What to put in the parent catergorie?

Any ideas? Tried a few things tonight but no success!

Link to comment
Share on other sites

One more thing. With every maincategory I have the subcategory "Hardware". It imports successfully, but then there is only 1 subcategory Hardware. The other ones are not there. So the name in de csv is the same, but the parent categorie is different.

Any ideas on this one?

Link to comment
Share on other sites

  • 2 weeks later...
Hello,

I saw a lot of people seem to have problems importing categories with CSV. I have attached a tutorial to show you step by step on how to make it work.. Hopefully it can save one of you some time.

Here you go...


Star,

Your tutorial is excellent! I have a problem with my category block that won't work anymore. I am thinking of doing a fresh install and import all my products and etc. I was playing with myphpadmin and there is an export option to save the data into .cvs . As I was following your tutorial but can't get it to work. I read in the tutorial too that you manually crated the spread sheet. Is there any shortcuts? How can I restore my shop trouble free?

Many thanks,
Link to comment
Share on other sites

  • 2 months later...

Hi there,

I'm new to prestashop.

The problem I have is with importing products.

I have already setup categories called "Artists A" Artist B to Artist Z in the "home" Category. (using csv import)
***See pic1***

I have also created sub categories under the "A Artist" these subcategories are the artists names "starting with A".

When I import the products (for the A Artists subcategories only) using csv file, most of the products go to the correct subcategories.

However, for some reason, prestashop duplicates 5 sub categories and creates a category for each of the 5 in the "home category" and also places a selection of the products that should have gone to my previously created subcategories under the A Artist category.

See ***pic2*** with highlighted area.

Really need help to figure out why this happens !
Any help appreciated.
thanks
Paul

8969_iwwSpK8nEprR3jyHAxpy_t

8970_vz0Odpub1ut8jEi7sOJq_t

Link to comment
Share on other sites

  • 3 months later...
  • 3 months later...
  • 2 months later...

Is there not a way to import the products to the sub category without spending hours making all the categories before you import. Like now I have a store that has well over 10,000 products. To update the inventory counts I have to delete all the products and import a new csv with the correct inventory counts. The store should have categories with sub category but its such a pain that I simply just upload all the products to their home categories.

I came from zen cart and with that we had in the csv file category, subcat1, subcat 2 ect. Made it very easy to import to the right areas and subs. One problem I have found with Prestashop is that it uses numbers for category instead of real names. So I wipe out my whole catalog, categories and all every week to update inventory counts. I make one csv and put the real name in the category spot. Do my import then as I am adding products to the featured on home page I set the categories to show on the home page. Its kinda a round about way of doing things but it works. Would be better if the powers that be would think about adding the cats, subcat1 ect to the import feature. Would make life a lot easier on some of us, and would be really nice if we could have one file to import everything. One file that would import the cats, subcats, products.

  • Like 1
Link to comment
Share on other sites

Maybe a stupid question but:

My site consist of just virtual goods (photos etc)
I need to add about 200 items a week witch take a LOT of time to add them.
Is there a way to add them by CSV import? Or maybe another way?

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

I have imported categories, but due to mistake in CSV it looks like "loop" and I cannot access menu Catalog from administration panel to remove it and import again. I get blank page and HTTP 500 error after some time.

Any ideas, how to get access to erase unneeded categories?

Thanks!

Link to comment
Share on other sites

If the Catalog tab in the Back Office is inaccessible because of a loop in categories, you'll have to edit your database using phpMyAdmin and remove the categories manually from the ps_category and ps_category_lang tables.

Link to comment
Share on other sites

  • 5 months later...
Maybe a stupid question but:

My site consist of just virtual goods (photos etc)
I need to add about 200 items a week witch take a LOT of time to add them.
Is there a way to add them by CSV import? Or maybe another way?


Yes, U can. I export my products from excel "database".
You need to save a file in Excel as "CSV comma delimited" type and u can import this file from Presta backoffice.
Link to comment
Share on other sites

  • 2 weeks later...
  • 9 months later...
  • 3 weeks later...

Hello

I have a problem with subcategories.

I am importing 3 main categories Passenger Cars, Trucks, Motorcycles

and 2 subcategories Honda, Volvo.

In Parent field of Honda subcategory I put ids of main categories separated by other separator or semicolon

In one Parent field I have more than 2 Ids and it didn't import correctly.

While I type only one parent id in field it imported data correctly.

What's the problem ?

I wouldn't like to duplicate rows for the same thing ?

I am using Presta Shop 1.4

Link to comment
Share on other sites

Hi

 

So I´ve read all of this and tried a lot of things but without success.

How should i modify this file for it to work.

My biggest concern is that the subcategories don't become subcategories, the come as maincategories.

 

So this product shows up in 2 maincategories, "figurer" and "bamse"

 

 

ID;category;EAN;Namn;Totalt antal;price;Leverantor

1;figures,Bamse;997317;Bamse;18;49;Karnan

Link to comment
Share on other sites

  • 1 year later...

Hello everybody. I am trying to import categories for two languages.

When I import categories for lang 1 - everything is ok.

Then I import them for lang 2. It is imported without any errors, but in back office it seems like last language replace the first one. And in both languages in the front office are displaying names of categories from the second lang.

May be somebody knows what can be the reason of such behavior?

Thank you.

Link to comment
Share on other sites

  • 7 months later...
  • 8 months later...

Check this CSV file that cover all the fields, with this you should be able to add meta-data, images, and everything else as well

But note that you should start your ID with the Database table auto increment current value because category's ID won't be fetched from the CSV for some reason ;-)

 

 

With this answer I believe this post should be marked as solved so ENJOY importing your categories ;-)

post-725794-0-05371300-1392204682_thumb.gif

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

The tutorial only gives the procedure to upload categories but there is no procedure for subcategories. Please upload a sample CSV. 

 

Thank you

Category and subcategory could be defined via ID and parent_id

 

for example we have category named (shoe) and there are two categories (men, women) under it

 

so it will be

(id:100, name:shoe, parent_id:2)

(id:101, name:men, parent_id:100)

(id:102, name:women, parent_id:100)

 
Link to comment
Share on other sites

  • 5 months later...
  • 2 weeks later...

 

Hi, how do I create a csv file to import 100 subcategories in a particular category? 
use prestashop 1.5.6.2

 

 

 

 

Hi, how do I create a csv file to import 100 subcategories in a particular category? 
use prestashop 1.5.6.2

 

 Look at the attached file.

By default:

"Root" category ID = 1

"Home" Category ID=2

Do not include Home and Root categories in your file as rows.

 

Your categries ID's start from number 3 or 4 or 5 etc... (Row number 1).

Look at file:

* ID parent 2 = Home category.

* ID Categories 6,7,8,9,11,12 are under "Home" category.

* ID Categories 3,4,10 are under ID category 9 (ID category 9 is a category but also a parent under 

   id_parent column)

* ID Categori 5 is under category 10.

 

Catgory ID 2 (HOME)

        I-- Category 6

        I-- Category 7

        I-- Category 8

        I-- Category 9

        I             I-- Category 3

        I             I-- Category 4

        I             I-- Category 10 

        I                           I-- Category 5

        I-- Category 11

        I-- Category 12

post-516384-0-29020300-1410345295_thumb.jpg

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

  • 3 weeks later...

well i must say that this post was by far more explicit and useful in terms of importing categories in a csv file than the official documentation.

 

I'm not sure if i was doing something wrong or a setting that i miss. But when i tried to import categories using the sample of "CSV Import" page of the admin panel it would never work.

It does not mention anything about not using id 1 and 2 in your csv file as these 2 IDs are already use for the root and home category.

 

Also, in the sample file, the column called "Parent Category" is showing the word "Home". Which makes you understand to write the name of the parent category since it is the example given. And every time i was following this example, none of my parent category would be set-up properly. All my categories were showing as sub-category of "Home".

But after looking at the sample given on this thread showing to use the ID of the parent category in the "Parent Category" column, i changed all my "Parent Category" values to match the ID and not the name.

 

And taaa daaa ! it worked right away! All my parent categories and sub categories were properly set-up in PS.

 

Again, maybe i missed an option some where. But for me, the sample file and documentation page (http://doc.prestashop.com/x/uAA6AQ) would need to be revised.

 

In any case, thank you very much PSdilemma for your very simple and clear explanation.

 

Cheers

Link to comment
Share on other sites

  • 8 months later...
  • 6 months later...
  • 1 month later...
  • 1 month later...

Hi,
 
I have created a CSV for Categories and uploaded it successfully but the catogories and the sub-categories are not shown in Catolog->Categories. When I configure a Module Top Horizontal Menu in that under Available items Categories can be seen and added to UI as well. When I click on the category in UI 404 error comes.
Any idea how to fix this?
Thanks in advance.

Link to comment
Share on other sites

  • 4 weeks later...

I'm a newbie so I hope that I'm not stating the obvious but from my efforts today it seems that the main Categories have to go under the 'Home' category as that seems to be the only root category (so you need to make sure that your main categories are not assigned the 1 for root categories). You then assign the sub-categories to the appropriate 'Main' category. So a 'Main' category of 'Shirts' would go under 'Home' and the sub-category of 'Mens shirts' would go under the Shirts 'main' category on the import. Effectively Main Categories are a sub-category of 'Home'. This was trial and error for me so behavior of categories prior to my import as above was erratic.

 

<edit> I see the above was addressed above.
 

Not sure how to import the inventory with sub-categories though, if anyone knows.

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

  • 7 months later...
  • 3 months later...
×
×
  • Create New...