You are here:  » How to Limit category Hierarchy up to 3 level For menu


How to Limit category Hierarchy up to 3 level For menu

Submitted by keshavkshirsagar on Wed, 2015-08-19 11:31 in

Hello Sir

I have multilevel category Hierarchy up to 6 to 8 levels
I want to show only up to 3 level category in ajax menu for 15/09A

Submitted by support on Wed, 2015-08-19 12:08

Hi,

Sure - in html/html_categories.php look for the following code at line 6:

  $sql2 = "SELECT * FROM `".$config_databaseTablePrefix."categories_hierarchy` WHERE parent='".$parent."'";

...and REPLACE with:

  $sql2 = "SELECT * FROM `".$config_databaseTablePrefix."categories_hierarchy` WHERE parent='".$parent."'";
  if ($parent)
  {
    $ch = tapestry_categoryHierarchyArray(array($parent));
    $depth = count(explode("/",array_shift($ch)))+1;
  }
  else
  {
    $depth = 0;
  }

Then look for the following code at line 25:

      if (database_querySelect($sql3,$rows3))

...and REPLACE with:

      if (($depth < 3) && database_querySelect($sql3,$rows3))

Cheers,
David.
--
PriceTapestry.com

Submitted by keshavkshirsagar on Wed, 2015-08-19 13:10

Thanks :)