Quote Originally Posted by Rookie gone MAD! View Post
Hi!
i want to use the categories_select side box module but would like to know how to add the new products, all products, featured products and specials, ect links like on the standard catagories list?

also i want to be able to switch the subcatagories off?

can anyone help PLEASE?
I've got the fix for people who want NO SUB CATEGORIES showing in their drop down menu.

First, open up includes/functions/functions_categories.php

Save a backup, as this is a core override, and there is no override folder for function files.

Then add this new function:

Code:
function zen_get_categories_no_sub($categories_array = '', $parent_id = '0', $indent = '', $status_setting = '') {
    global $db;

    if (!is_array($categories_array)) $categories_array = array();

    // show based on status
    if ($status_setting != '') {
      $zc_status = " c.categories_status='" . (int)$status_setting . "' and ";
    } else {
      $zc_status = '';
    }

    $categories_query = "select c.categories_id, cd.categories_name, c.categories_status
                         from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
                         where " . $zc_status . "
                         parent_id = '" . (int)$parent_id . "'
                         and c.categories_id = cd.categories_id
                         and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                         order by sort_order, cd.categories_name";

    $categories = $db->Execute($categories_query);

    while (!$categories->EOF) {
      $categories_array[] = array('id' => $categories->fields['categories_id'],
                                  'text' => $indent . $categories->fields['categories_name']);
      
      $categories->MoveNext();
    }

    return $categories_array;
  }

////
You can add it wherever you want, I added it right after the code for function zen_get_categories.

Now open up includes/templates/YOUR_TEMPLATE/sideboxes/tpl_categories_select.php

and change:

zen_get_categories

to

zen_get_categories_no_sub

VOILA!