Displaying all categories and sub-categories in category box in osCommerce

osCommerce by default displayes only top level categories in category box. To display all categories and sub-categories hierarchy in category box follow these instructions.

Steps:

  1. index.php – change on around line 37:
    if ($category_depth == 'nested') {
    

    To:

    if ($category_depth == 'nested' && isset($HTTP_GET_VARS['cPath'])) {
    
  2. includes/application_top.php – change around line 437:
    $cPath = '';
    

    To:

     $cPath = '0';
    
  3. includes/modules/boxes/bm_categories.php – find around line 99:
     $parent_id = $categories['categories_id'];
    

    Add:

     $dbs[] = $categories['categories_id'];
    
  4. includes/modules/boxes/bm_categories.php – change at around line 109:
     while (list($key, $value) = each($cPath_array)) {
    

    To:

     while (list($key, $value) = each($dbs)) {
    

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.