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)) {
    
Advertisements

Ask J

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s