Jump to content

[Work-a-round Found] Importing Categories - some sub-categories missing


Recommended Posts

I've got my entire catalog including categories and products typed up in 2 Google Doc spreadsheets (one for categories, one for products).

I am exporting these spreadsheets as CSV files, and then uploading and importing them into Prestashop.

When I import the categories, all of the parent (main) categories seem to appear, but only about half of the sub-categories appear. I have checked, double checked, and triple checked to make sure all of the parent category values for the sub-categories are correct.

The only thing I can possibly think of that is causing this problem is MAYBE some encoding issues with Google Docs? Although if that were the issue, wouldn't everything be messed up?

Any advice would be greatly appreciated!

Link to comment
Share on other sites

I don't know if this is relevant and of any help, but when I imported my products (over 5000)... I first created the categories and subcategories in the BO. I made sure to not name any of the subcategories or categories with the same name, I wanted to import them to their appropriate location and then I could go back and modify the name to be more fitting. Also, because we had so many products and category names that changed from the previous shop we had to best guess some of our products and put them in the subcategory we felt they best belonged to or left them in the parent category so we could later manually move them. Moving a hundred or so misplaced products would be better than 5000.

Anyways, I digress. So in our excel file I created a new column for the categories, and listed the category and subcategory's name in that column. As I mentioned before, since we didn't have two categories or subcategories with the same name it wasn't a problem differentiating the products into their appropriate category/subcategory. So we used the actual text name format to import the categories, instead of their ids. It goes without saying that you have to make sure the text "names" you copy into the category import column must be exactly the same as the names of your categories defined in the BO.

I noticed that dividing the categories into parent and subcategories were unnecessary. As long as they all had different names, PS treats them as different categories and does not differentiate whether it is a parent or sub or sub-sub category.

HTH!

  • Like 1
Link to comment
Share on other sites

Hm... not sure if that helps or not, but I'll keep reading it over a couple more times and think it over. I'm sure it will help in SOME way or another ;)

But your post also made me think of a couple other things I should mention...

3 of the parents categories have the same named subcategories. For example:

Cars
- Red
- Blue
- Black

Trucks
- Red
- Blue
- Black

Bikes
- Red
- Blue
- Black



Only 1 of the 3 main categories is displaying its proper 3 sub-categories. Maybe there is some sort of problem because 3 main categories have identical sub-categories? I'm beginning to think that this is where the problem is occurring.

Second, you said

It goes without saying that you have to make sure the text “names” you copy into the category import column must be exactly the same as the names of your categories defined in the BO.


Right now I have my main categories listed as "01.Trucks" "02. Cars" and "03.Bikes" so that I can have the categories appear in order that I want. I'm not sure how this would affect the importing process and if it would cause confusion when attempting to differentiate "Trucks" from "01.Trucks" For that reason, I like importing categories and products using the ID's numbers I have assigned in the spreadsheet.
Link to comment
Share on other sites

Hm... yea I'm not too sure how using the numbers to organize categories will affect the import... my guess is it will, since the name of the category is still "0.1Trucks" or "02.Cars" but PS uses these numbers to rather organize the categories and to ignore the defined prefixed numbers when it gets and outputs the data, but my guess is this step is way after the importing has occurred. So I guess what I am saying is that I don't think PS has the ability to analyze and convert those prefixed numbers prior to or during import. I AM NOT IN ANYWAY SURE ABOUT THIS ONE. haha.

My best guess is, yes, something is occurring with the identical subcategories that may be causing the problem.

You know I would recommend that you rename your categories without the prefixed numbers, since its more important to import the products into their right categories than is the order of those categories (which you can later reorganize). I would also rename all those subcategories to something unique to other subcategories (whether they are in the same parent category or not - PS doesn't differentiate the two anyways). Then you will have unique category "names" to use to import them to their rightful categories. Once you verify they are all in the right places... you can then rename the subcategories back to how you have it, and also rename the categories with their prefixed numbers to organize them again.

HTH!

Link to comment
Share on other sites

I would think that have the prefixes such as 01. 02. or 03. would not affect the importing of sub-categories or products since Prestashop identifies categories and sub-categories by their numerical ID #, and not their actual text name.

Although, since having identical named sub-categories is messing up, I'm afraid the same may happen with my products since some of them have the same names as well.

Right now I'm going to try changing the sub-categories names in the spreadsheet, import them into prestashop, and then change them back so they are identical and see if that works. I'll report back.

*EDIT* Ok, we're getting somewhere.

I went back to the spreadsheet and renamed the sub-categories Red1, Red2, Red3, Blue1, Blue2, Blue3, Black1, Black2, Black3.

Exported Google Doc spreadsheet, imported CSV file into prestashop, and everything showed up right. Then I imported my products, and they all went to the correct places (including the products that had the same names). Then I went into the Back Office and re-named all the sub-categories as just Red, Blue, and Black. Everything is still working fine.

Soooo, the Import tool isn't really working as it should, but I have found a work-a-round.

Thanks for your help, mytheory. I really appreciate it :)

Link to comment
Share on other sites

The prefixes are used within PS, in the code it looks for these certain prefixes and when it picks it up it executes what ever it supposed to do. But I don't think this part of the code is accessed during the import process. Unless... when you enter those categories with the prefixes the code executes and inputs the category names without the prefixes but in the specified order into the database (ps_category_lang). Then when the import happens and it looks through the database for those names it will appear without the prefix.

Yea PS uses the category_id to identify the categories within the code, and I was skeptical when I first setup my import file with the category's text names instead of using the ids, but it worked.

I just confirmed again that, at least during the import process, you don't need to define the category field with their id (although this probably works too) but can use their text name as long as they are unique and an exact match.

HTH!

Link to comment
Share on other sites

Ok, we’re getting somewhere.

I went back to the spreadsheet and renamed the sub-categories Red1, Red2, Red3, Blue1, Blue2, Blue3, Black1, Black2, Black3.

Exported Google Doc spreadsheet, imported CSV file into prestashop, and everything showed up right. Then I imported my products, and they all went to the correct places (including the products that had the same names). Then I went into the Back Office and re-named all the sub-categories as just Red, Blue, and Black. Everything is still working fine.

Soooo, the Import tool isn’t really working as it should, but I have found a work-a-round.

Thanks for your help, mytheory. I really appreciate it ;)

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...