Missing categories…
-
Trying your product, I wanted to test suggestions based on categories, but I miss some categories…
As a matter of fact, the problem comes fromextra_func_hierarchical_sort
. If I comment the call to this function insidecondition_product_category
I get all my categories.I did some debug and all I can end with is that just before the final following:
for($i = $max_depth; $i >= 0; $i--) { foreach($terms as $term) { if( $term->depth == $i ) { if( isset($temp_terms[$term->term_id]) ) { $term->child = $temp_terms[$term->term_id]; } if( $i != 0 ) { if( ! isset($temp_terms[$term->parent]) ) { $temp_terms[$term->parent] = array(); } $temp_terms[$term->parent][$term->term_id] = $term; } else { $new_terms[$term->term_id] = $term; } } } }
the
$terms
array is correct and just after it’s wrong (Before:$terms[14]
was parent of$terms[15]
to$terms[17]
/ After: $terms[14] is a copy of$terms[17]
-> as a parent is missing, no member of the family gets into$new_terms
! Nota:$terms
has 17 elements).
I ran some tests, reordering ‘families’ and everytime, the last parent is replaced by the last child… Strange!
Inside thisfor
a ‘child’ key is set for some entries of$terms
, so I would bet for a memory problem… A maybe a PHP bug? Very strange as adding a ‘depth’ element earlier in the function did not create any problem.Or maybe it has something to do with the fact that my last parent slug (and name) starts with a “z”?
The page I need help with: [log in to see the link]
- The topic ‘Missing categories…’ is closed to new replies.