Adding Category Groups

The following modification changes the vertical category navigation so that only subcategories of a particular group are shown. This is helpful if you want to 'group' categories.

VERSION 2.8x

Version 2.8 can use the following modification, but it's not required. You can simply use %CATEGORY_VERTICAL_X% in your template (where X is the category id).

For instance, category #7 will have a link that looks like

website/category_7/categoryname.htm or website/catalog.php?category=7

So you would use %CATEGORY_VERTICAL_7% in the template.

Other Versions:

  1. Open the navbar_vertical.php page in the /enc/ folder.

  2. VERSION 2.7x:

    • Open the navbar_vertical.php page in the /enc/ folder.

    • Add the lines:

      if (!empty($parentcat))$showmnonly = "no";

      just under the line:

      $showmnonly = "no";
  3. VERSION 2.55:

    • Just under the opening

      if (empty($parentcat) OR isset($_REQUEST['$parentcat']))
      $parentcat = 0;
    • Find the line:

      $categoryquery = "SELECT Category, Image, ID FROM " .$DB_Prefix ."_categories WHERE Parent = '' AND Active = 'Yes' ORDER BY CatOrder, Category";

      and change the Parent to $parentcat, so you'd have:

      $categoryquery = "SELECT Category, Image, ID FROM " .$DB_Prefix ."_categories WHERE Parent = '$parentcat' AND Active = 'Yes' ORDER BY CatOrder, Category";
    • At the very bottom of the page, just above the ?> line, add:

      $parentcat = 0;
  4. Find the category number by clicking on the category name in the front end catalog. The link shows the number. For instance, category #7 will have a link that looks like

    website/category_7/categoryname.htm or website/catalog.php?category=7
  5. Now, in your template, wherever you want to display a set of subcategories, add:

    just above the %CATEGORY_VERTICAL% include (or the navbar_vertical.php include), changing the 1 to the category number you found earlier.