Community Add-Ons

Maintainers: DuFF1
Add file to this package
Top » Features

Remove sub-categories in categories box
for osCommerce Online Merchant v2.2

As seen in Oscommerce forum...

Remove sub-categories expand in the categories boxes.

Modify /includes/boxes/categories.php by adding /* and */ in the code to these lines:

===== STEP 1 ===== (optional)
Remove "->" after category name that indicate sub-categories availability. Remember, you simply need
to add /* before and */ after these lines.

/* if (tep_has_category_subcategories($counter)) {
$categories_string .= '->';
}
*/


===== STEP 2 =====
Will remove sub-categories in categories boxes

/*
//------------------------
if (tep_not_null($cPath)) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {
unset($parent_id);
unset($first_id);
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
if (tep_db_num_rows($categories_query)) {
$new_path .= $value;
while ($row = tep_db_fetch_array($categories_query)) {
$tree[$row['categories_id']] = array('name' => $row['categories_name'],
'parent' => $row['parent_id'],
'level' => $key+1,
'path' => $new_path . '_' . $row['categories_id'],
'next_id' => false);

if (isset($parent_id)) {
$tree[$parent_id]['next_id'] = $row['categories_id'];
}

$parent_id = $row['categories_id'];

if (!isset($first_id)) {
$first_id = $row['categories_id'];
}

$last_id = $row['categories_id'];
}
$tree[$last_id]['next_id'] = $tree[$value]['next_id'];
$tree[$value]['next_id'] = $first_id;
$new_path .= '_';
} else {
break;
}
}
}
*/

Legend:  Download   Report
Expand All / Collapse All
Link to original DuFF1 21 Dec 2006  

The most part of this package was taken in the forum:

http://forums.oscommerce.com/index.php?showtopic=235321

I simply put it in a contribution for better access.

I added code to remove the "->" after each categories that have sub-categories.

Remove sub-categories in categories box DuFF1 21 Dec 2006