Jump to content

Problem Importing Sub Categories With Same Name - Is this a bug?


SteveM

Recommended Posts

I have imported my categories via a csv file successfully, but I'm having issues when attempting to upload sub categories via another csv file if I attempt to use the same naming convention for multiple categories.

I have my main category import file as follows:

ID    Active    Name    Parent Category
2         1      VW Golf          1
3         1      VW Jetta         1
4         1      VW Polo          1



Which results in a menu similar to this:

VW Golf
VW Jetta
VW Polo



Now within each category I want to import the following sub-categories

If I import a csv file with just one group of sub categories:

ID    Active    Name    Parent Category
100    1    01.Exterior         2
101    1    02.Interior         2
102    1    03.Wheels           2



My menu displays correctly with categories & a sub category

[-]VW Golf
   Exterior
   Interior
   Wheels
VW Jetta
VW Polo



But if I use a csv file with multiple sub categories for all categories:

ID    Active    Name    Parent Category
100    1    01.Exterior          2
101    1    02.Interior          2
102    1    03.Wheels            2
103    1    01.Exterior          3
104    1    02.Interior          3
105    1    03.Wheels            3
106    1    01.Exterior          4
107    1    02.Interior          4
108    1    03.Wheels            4



This is what I get:

VW Golf
VW Jetta
VW Polo



No sub categories are displayed!

Is this a bug or am I doing something wrong?

Link to comment
Share on other sites

  • 2 weeks later...
  • 6 months later...

The last time it was reported as a bug, the Prestashop team chose to add a message rather than fix it, so I'm guessing they won't. I noticed that you filed a bug report on it. It will be interesting to see whether they decide to fix it this time. One thing you could try is adding a different number prefix to each category with the same name. That should trick the importer into creating multiple categories with the same name, unless it strips the prefix before comparing.

Link to comment
Share on other sites

  • 2 years later...

Another solution for importing the categories with the same name:

 

I mark them with some unique strings to distinguish them in CSV file:

1) Categoryname somestring

2) Categoryname someotherstring

 

And after successfull import I cut the string in database with this simple query (you have to change the column and fields):

 

UPDATE table_name SET column_name = REPLACE(column_name,'original_string','replace_string')

Edited by webplus (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...