Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Drop down menu per category/sub categories

Drop down menu per category/sub categories

Views: 887

Results 1 to 1 of 1
20 Jul 2014, 6:44 PM
#1
petergy avatar

petergy

New Zenner

Join Date:
Sep 2012
Posts:
65
Plugin Contributions:
0

Drop down menu per category/sub categories

Hi there,

I am putting a clothing store together and trying to customize the drop down menu for the categories. I have "men" "women" "kids" and so on categories on the top menu bar. When visitor hovers over for example the "men" category, I would like only the subcategories and their subs that belongs to the "men" category to show up. How do I do that? Can someone give me an example, please? I have managed to put all categories under my "men" category, but I can not figure out how to have just the "men" subs to show. Please see below. Thank you.

<!-- men link begins -->
                <?php 
                $cat_query = "select * from ".DB_PREFIX."categories where categories_status='1' ORDER BY RAND() LIMIT 1";
					 $category = $db->Execute($cat_query);
				         $categories_id=$category->fields['categories_id'];
					 ?>
                <li id='men'><a href="http://www.impex12.com/men"><?php echo HEADER_TITLE_MEN; ?></a>
                <?php
    				
     // load the UL-generator class and produce the menu list dynamically from there
     require_once (DIR_WS_CLASSES . 'categories_ul_generator.php');
     $zen_CategoriesUL = new zen_categories_ul_generator;
    $menulist = $zen_CategoriesUL->buildTree(true);
     $menulist = str_replace('"level4"','"level5"',$menulist);
     $menulist = str_replace('"level3"','"level4"',$menulist);
     $menulist = str_replace('"level2"','"level3"',$menulist);
     $menulist = str_replace('"level1"','"level2"',$menulist);
     $menulist = str_replace('<li class="submenu">','<li class="submenu">',$menulist);
     $menulist = str_replace("</li>\n</ul>\n</li>\n</ul>\n","</li>\n</ul>\n",$menulist);
	 echo $menulist;
    ?>
    	         
                </li>
                <!-- men link ends -->