Problem with categories in Prestashop

Asked

Viewed 207 times

0

Hi, I’d like someone’s help, I’ve had this problem for days and there’s no research that could solve this.

I am testing a product import tool in Prestashop, and after some tests I went to delete the products, but this time I decided to delete the categories and consequently delete the products (Prestashop provided this option) only after I did it, when access to panel products 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]

Tela com o erro

I have looked on several websites but the problem is not easily solved just by creating a Root category, or I am doing the same incorrectly.

Lista de categorias existentes

I am using Prestashop 1.6.1.3

2 answers

0

Checks whether in the database in the table ps_category_lang there is the category root with ID=1 and the category "Start" with id=2.

If it doesn’t exist you’ll have to create it manually in the database.

id_category --> Value = 1

id_shop --> Value = 1

id_lang --> Value = 1

name --> Value = Root

link_rewrite --> Value = root

Other fields can be blank

0

Hello.

This occurred because you deleted the root(main) category, it should not be deleted. To fix, create a new category from the Prestashop dashboard (if you can’t, create it directly in the database), then go to the category table in the database (e.g., "ps_category") and assign the value "1" in the "is_root_category" column".

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.