Jump to content

Root category deleted by mistake


bonsaiko

Recommended Posts

Hello,

 

I was making some import tests because I have a huge catalog to import, so first I tried to import categories. 

I did it several times and at the end I chose to delete everything to start with something clean. 

At some point, I also deleted rows in the database and now I have a big error message when clicking on the product tab:

 

 

Root category must be an integer value
at line 212 in file classes/helper/HelperTreeCategories.php

 

Anyone could help me please ? I wouldn't like to start everything from scratch.

Thanks

Link to comment
Share on other sites

You can re-import your categories with the root and home categories. For example, make sure the following columns have the following values:

 

ID;Name;Parent category;Root category (0/1)

1;Root;0;0

2;Home;1;1

3;Your Category;2;0

 

Make sure all your main categories have 2 as the parent category.

Link to comment
Share on other sites

Thanks.

I did as you said and it's not quite ok with categories... The root category appears in the sitemap, below the litlle house icon. 

And I still have the error when I click on Catalog / products.

I had deleted all the records in the products table, I guess I deleted too much.

I installed another prestashop to compare the tables, but it's not very easy. 

Categories table look the same, I don't understand why I don't have the same result

Link to comment
Share on other sites

  • 1 year later...

I had a similar problem on PrestaShop 1.7.4.2 where I accidentally deleted the Home category.

I tried CSV import but it didn't work for me so I manually edited the SQL tables and now it seems to be working.

These are the three SQL tables that I edited:
1) ps_category
2) ps_category_lang
3) ps_category_shop

 

I've attached the screenshots of these three tables with no additional user defined categories. The two categories present in the tables are Root and Home with are default.

 

ps_category.PNG

ps_category_lang.PNG

ps_category_shop.PNG

  • Like 2
Link to comment
Share on other sites

  • 8 months later...
  • 2 months later...

Just wanted to thank User17745 - copying your settings also saved me!

Also a further note - seems like the root category has to be 1 and the home category has to be 2. I tried to use 99999 and 100000 (the categories I'm importing in start from ID 1 so I was trying to work around this to stop them overwriting) but it didn't work.

 

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