Jump to content

recalculateLevelDepth() does not work recursive


Stefan6723

Recommended Posts

Dear All,

 

I am struggling with the recalculateLevelDepth function. I am using PS 1.6.1.4 at the moment.

 

So far I added to functions to my unique code:

 

Category::regenerateEntireNtree();

Category::recalculateLevelDepth($id_category_level_update);
 
the first works fine after i push 10-20 new categories... but the second one does not want to update the leveldepth. I tried to view the code in Category.php.
The function (recalculateLevelDepth) looks very easy it collets the all children, level depth then update with foreach.
 
Well here comes my problem, because the Recursive call only runs ones, however in the $categories i see 3 items...
 
Array
(    [0] => Array        (            [id_category] => 127            [id_parent] => 82            [level_depth] => 0        )    [1] => Array        (            [id_category] => 128            [id_parent] => 82            [level_depth] => 0        )    [2] => Array        (            [id_category] => 186            [id_parent] => 82            [level_depth] => 0        ))

Here is the print_r of the $categories...

 

Has somebody had the something similar problem? maybe there is another way to update level depth like (regenerateEntireNtree) if this is true could somebody help me to find it ?

 

Many thanks for your answer!

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