Problem with categories in Prestashop

0

Hello, I would like the help of someone, I have this problem for days and there is no research that solves this.

I'm testing a product import tool in Prestashop, and after performing some tests I've deleted the products, but this time I decided to delete the categories and consequently delete the products (Prestashop provided this option), but after I did, when I access the panel product page I get the following error:

[PrestaShopException]

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

207.     }
208. 
209.     public function setRootCategory($value)
210.     {
211.         if (!Validate::isInt($value)) {
212.             throw new PrestaShopException('Root category must be an integer value');
213.         }
214. 
215.         $this->_root_category = $value;
216.         return $this;
217.     }

HelperTreeCategoriesCore->setRootCategory - [line 2504 - controllers/admin/AdminProductsController.php] - [1 Arguments]
AdminProductsControllerCore->initContent - [line 189 - classes/controller/Controller.php]
ControllerCore->run - [line 367 - classes/Dispatcher.php]
DispatcherCore->dispatch - [line 58 - admin/index.php]

IhavealreadylookedatseveralsitesontheinternetbuttheproblemisnoteasilysolvedjustbycreatingaRootcategory,orIamdoingthesamewrongly.

I'm using Prestashop 1.6.1.3

    
asked by anonymous 20.03.2017 / 13:07

2 answers

0

The root category with ID = 1 and the "Start" category with id = 2.

If it does not exist you will have to manually create it in the database.

id_category - > Value = 1

id_shop - > Value = 1

id_lang - > Value = 1

name - > Value = Root

link_rewrite - > Value = root

Other fields may be blank

    
11.10.2017 / 18:11
0

Hello.

This was because you deleted the root (root) category, it should not be deleted. To correct, create a new category from the Prestashop panel (if you can not, create directly in the database), then access the category table in the database (ex: "ps_category") and assign the value "1" in the column "is_root_category".

This action tells Prestashop what the new category should be treated as root.

    
21.06.2018 / 21:47