More information.. As was pointed out previously by gazag, if one is using the includes/templates/custom_template/sideboxes/tpl_categories.php file with the code modified for the hideCategories add-on, the categories dropdown on the Advanced Search page will default to the last category on the dropdown list instead of "All Categories". Once I restore to the Zen Cart default for the includes/templates/custom_template/sideboxes/tpl_categories.php file, the dropdown defaults to "All Categories" as it should.. If I use the includes/templates/custom_template/sideboxes/tpl_categories.php file with the code modified for the hideCategories add-on, and then use the code posted by moosesoom, then all is right with the world..
Here is the relevant categories sidebox code if anyone is interested..
I just need to know if moosesoom's code is okay to use. It appears to fix the issue reported.. I just don't know what other "damage" it might do, and just need some feedback..Code:// Begin hideCategories code list($nada, $mycpath)= split('=', $box_categories_array[$i]['path']); $mycid = split('_', $mycpath); $categories_id = array_pop($mycid); $hide_status = $db->Execute("select visibility_status FROM " . TABLE_HIDE_CATEGORIES . " WHERE categories_id = " . $categories_id . " LIMIT 1"); if ($hide_status->fields['visibility_status'] < 1) { // End hideCategories code switch(true) { // to make a specific category stand out define a new class in the stylesheet example: A.category-holiday // uncomment the select below and set the cPath=3 to the cPath= your_categories_id // many variations of this can be done // case ($box_categories_array[$i]['path'] == 'cPath=3'): // $new_style = 'category-holiday'; // break; case ($box_categories_array[$i]['top'] == 'true'): $new_style = 'category-top'; break; case ($box_categories_array[$i]['has_sub_cat']): $new_style = 'category-subs'; break; default: $new_style = 'category-products'; } if (zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) { // skip if this is for the document box (==3) } else { $content .= '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">'; if ($box_categories_array[$i]['current']) { if ($box_categories_array[$i]['has_sub_cat']) { $content .= '<span class="category-subs-parent">' . $box_categories_array[$i]['name'] . '</span>'; } else { $content .= '<span class="category-subs-selected">' . $box_categories_array[$i]['name'] . '</span>'; } } else { $content .= $box_categories_array[$i]['name']; } if ($box_categories_array[$i]['has_sub_cat']) { $content .= CATEGORIES_SEPARATOR; } $content .= '</a>'; if (SHOW_COUNTS == 'true') { if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) { $content .= CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX; } } $content .= '<br />' . "\n"; } } } // hideCategories code





Reply With Quote
I'm sure I'll be back with more questions..

