How to fix category and subcategory depth problem in PrestaShop

PrestaShop stores that have been adding and removing categories or running modules for automatic and mass editing of categories and products often have a messed up structure describing category depth (category depth).

Incorrect category and subcategory depth manifests itself in incorrect breadcrumb display and mixed category display in external modules. It happens, among other things, through incorrect data import, errors in modules for mass editing of products and categories or moving subcategories between categories.

To fix the structure of categories and their depth, log in to the PrestaShop 1.6 database using, for example, phpMyAdmin and execute the following query:

UPDATE `ps_category` c1

INNER JOIN `ps_category` c2 ON (c2.`id_category` = c1.`id_parent`)

SET c1.`level_depth` = c2.`level_depth`+1;

The effect will be visible immediately. Categories and subcategories will display correctly.

If you need help with the development and operation of your PrestaShop - contact us. We will help you :-)

Comments (6)
from 6

niestety opisany sposób u mnie nie działa, nadal jest ten sam problem ze strukturą

jak już napisałem sposób u mnie nie zadziałał, kategorie nadal wymieszane, Wersja PrestaShop 1.6.0.14 poniżej odpowiedź z bazy: Zmodyfikowanych rekordów: 0. (Wykonanie zapytania trwało 0.0026 sekund(y).) UPDATE `ps_category` c1 INNER JOIN `ps_category` c2 ON (c2.`id_category` = c1.`id_parent`) SET c1.`level_depth` = c2.`level_depth`+1

Jeśli powyższe zapytanie nie modyfikuje żadnych rekordów, oznacza to, że u Pana problemem nie jest głębokość kategorii lecz brak kategorii nadrzędnych (parent category). Proszę o eksport tabeli `ps_category` i przesłanie jej na nasz adres mailowy - damy Panu odpowiedź w czym dokładnie jest problem.

WITAM. mam ten problem na presta 1..7 prosze o informacje czy jestescie w stanie pomoc. na jaki adres wyslac tabele ps_kategory

prestashow.pl [01:14 04/03/2020]

Marcin, napisz na kontakt@prestashow.pl z opisem problemu. Poinstruujemy co dalej

Witam, U mnie jest podobnie jak u kolegów. Myślałem, że ten wpis jest w stanie mi uporządkować ps category , dokładnie kategorię nadrzędną , główną. U mnie w tabeli ps category głowna ma id 138 a nie 1 .

No entries yet.