Thanks,
There was a small bug I change it and now it work
One thing – Not it display the category and the subcategory, his there a way that it will not display the category. I mean if I use <%get_categorys_by_id(2)%>
That it will display the subcategory of "2" but not the "2" itself
sub { my $cat = shift; my $all_ids = $DB->table('Category')->children($cat); push @$all_ids, $cat; my $tbl = $DB->table('Category'); $tbl->select_options ('ORDER BY Full_Name'); my $cond = GT::SQL::Condition->new('ID', 'IN', $all_ids); my $sth = $tbl->select ( $cond ) || die $GT::SQL::error; my @cats; while (my $hit = $sth->fetchrow_hashref) { $hit->{URL} = $CFG->{build_root_url} . $tbl->as_url($hit->{Full_Name}) . '/' . $CFG->{build_index}; push @cats, $hit; } return { cat_loop => \@cats } }
There was a small bug I change it and now it work
One thing – Not it display the category and the subcategory, his there a way that it will not display the category. I mean if I use <%get_categorys_by_id(2)%>
That it will display the subcategory of "2" but not the "2" itself
sub { my $cat = shift; my $all_ids = $DB->table('Category')->children($cat); push @$all_ids, $cat; my $tbl = $DB->table('Category'); $tbl->select_options ('ORDER BY Full_Name'); my $cond = GT::SQL::Condition->new('ID', 'IN', $all_ids); my $sth = $tbl->select ( $cond ) || die $GT::SQL::error; my @cats; while (my $hit = $sth->fetchrow_hashref) { $hit->{URL} = $CFG->{build_root_url} . $tbl->as_url($hit->{Full_Name}) . '/' . $CFG->{build_index}; push @cats, $hit; } return { cat_loop => \@cats } }