Jump to content

Issue on category import when keeping id's


Recommended Posts

Hello, 

 

we try to integrate PrestaShop as an new frontend to our existing product infrastructure. This means we allready got a huge set of products, categorys and so on.

But if I try to import our existing categorys to presta, of course with keeping the id's, it triggers about a ton of weird things.

 

First thing is, that presta has its own root category. Im not sure why. This blocks the id's 1-2, again: not sure why this is needed, whitch makes workarounds necessary if you allready have an set of ids. Thats odd, but nothing id * 10 could not solve. So I thought.

 

But as soon you have categories without continous items in presta almost everything starts to fiddle around.

Example Id's: 10, 20, 30, 40, 50, 1923, 2820

 

First Issue: Import works. But the navigation bar will not be populated. 

Solution: Populate it manually

 

Next Issue: You populate the menue manually, but all links simply point to the homepage root. First I thought its about friendly url features. But no. It was not. 

Solution: Look at the database. In my case the "depth" was not set by the import algo. Some recursive statements can fix that but its nasty.

 

Final Issue: But thats not all. If you follow that link you will hit 404. Presta itself is simply not able to 'work' with this data. This counts for the block-menue Feature. For the Category overwiev itself. For everything.

 

Conclusion

PrestaShop simply cannot handle "random" but unique id's in its core. I had a look at some module sources and always hit the point that the core seems to have trouble with it. Im not sure why. Its almost like someone used an for(i; count(items); i++) loop instead of foreach at some point. 

 

I hope that this might be solved in the near Future. Otherwise I can imagine that many companies with an existing marketplace wont like this .... 

 

 

And before someone dares to ask: Yes, everything is setup properly. As soon you import without keeping the ids it works smooth and nice.

 

Noticed another Issue: If you import an category tree, and you need to switch off "keep ids" it will kill your tree structure. You will hit errors like "cannot find parent id" because Presta changed this parent Id - but never took care About an translation of thoose.

 

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