bonsaiko Posted October 31, 2016 Share Posted October 31, 2016 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 valueat 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 More sharing options...
rocky Posted November 1, 2016 Share Posted November 1, 2016 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 More sharing options...
bonsaiko Posted November 2, 2016 Author Share Posted November 2, 2016 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 More sharing options...
rocky Posted November 2, 2016 Share Posted November 2, 2016 Check also the ps_shop table and make sure the id_category is set to 2. Link to comment Share on other sites More sharing options...
bonsaiko Posted November 3, 2016 Author Share Posted November 3, 2016 Thanks, it seems to be ok now. Link to comment Share on other sites More sharing options...
User17745 Posted August 4, 2018 Share Posted August 4, 2018 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. 2 Link to comment Share on other sites More sharing options...
Wizico Zypher Posted April 25, 2019 Share Posted April 25, 2019 User17745 You have just saved my bacon! Anyone who stumbles upon this post. this worked like a charm. Good lesson to make a backup of the database before you start doing data migration or manipulation of any sort. Many thanks again! Wizico_Zypher Link to comment Share on other sites More sharing options...
GreenGiant Posted June 25, 2019 Share Posted June 25, 2019 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now