Hi
this code I have from @teseo "thanks"
<?php
function cust_show_only_selected_categories() {
if(osc_is_home_page()) {
$categoriesToShow = array(31, 59, 8, 75); // Put here Id's of parent categories or subcategories (no sub-subcategories)
$categories = Category::newInstance()->toTree();
foreach ($categories as $key => $cat) {
if (!in_array($cat['pk_i_id'], $categoriesToShow)) {
foreach ($cat['categories'] as $key2 => $subcat) {
if(!in_array($subcat['pk_i_id'], $categoriesToShow)) {
unset($categories[$key]['categories'][$key2]);
}
}
if (!$categories[$key]['categories']) unset($categories[$key]);
}
}
View::newInstance()->_exportVariableToView('categories', $categories);
}
}
osc_add_hook('before_html', 'cust_show_only_selected_categories');
?>
does not display correctly ...
It will display all categories ... continue
someone has a tip?
thanks, spevoli