Jump to content

Problem importing CSV (Categories file)


Crystal Wizard

Recommended Posts

I have a Categories CSV file from my supplier (along with  a Products CSV).

 

When I try to import the Categories file, I get many errors, and the categories either do not import, or import wrong (uses Number instead of text-name, do not nest properly).

 

I have tried deleting the categories, and also using the Force Delete before Import function.

 

My "Home" category now has ID 2, which clashes with an ID from my CSV.

Altering the CSV will be a huge amount of work, and would have to be done each time the CSV is updated/re-imported. :(

 

What ID should my "Home" Category have (0?) and is there a way of altering it? 

Using the Edit function does not give me the option of altering the ID. 

 

Is there a simple way of completely resetting the Categories (and Products) list to default values?

 

Thanks in advance.

Link to comment
Share on other sites

Two is the normal value for the home category (unless it is a 1.4 upgrade or part of a multishop). The number 1 is for the "root" category that is above the home(s) and was added for multishop.

 

However, this is not the necessary order. In an upgrade from 1.4 you will see that root has some high id number as it is only added later.

 

Changing the id of categories would be risky business as you would need to do that directly in the database and the same way for all tables in which is_category is used.

Link to comment
Share on other sites

OK, thanks for clearing that up.

 

I now get a database error "Parent Category does not Exist"

 

I believe this may be to do with importing many Categories at once, as they are multi-layered.

Some categories are not defined until further down the list.

 

I have tried sorting by Category ID, but e.g. Category 48 has parent 155 (Not defined until later)

I have tried sorting by Parent ID but e.g. Category 52 has a parent 51 - but 51 has parent 155 - not defined until further down list

 

I seem to be in Catch-22 :(

Link to comment
Share on other sites

I have sort-of solved this by splitting the CSV into several (4) parts, and importing them separately. 

It is a bit of a faff, but gets there.

 

I have to check the parent-categories, and split the file for Import so that each Parent is done in order - I'm thinking of them as Prerequisites:

52 has a pre-req of 51, which has a pre-req of 155 ...

48 has a pre-req of 51.

So load a section with 155, then 51, then 52 and 48 ...

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