News:

Support the VirtueMart project and become a member

Main Menu

sub-categories possible?

Started by stevennestler, November 18, 2011, 13:49:57 PM

Previous topic - Next topic

stevennestler

Is it possible to have sub-categories?
Thanks,
Steven

PRO


rooney

How to get more levels of sub-categories??
By default we get only 2 category levels in VM2.
I m using Joomla!1.7.3 and VM2.

jenkinhill

When entering your new category under Details / Category Ordering  select the second (third or fourth) category below which the new one should sit.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

rooney

#4
Ya i have inserted all the categories and sub-categories.
I have the 3rd level sub-categories but cant see it. :(
I am using "mod_virtuemart_category" module which was included in VM all in one installer and code for default.php is shown below:
Quote<?php foreach ($categories as $category) {
   $active_menu = '';
   $caturl = JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$category->virtuemart_category_id);
   $cattext = $category->category_name;
   //if ($active_category_id == $category->virtuemart_category_id) $active_menu = 'class="active"';
   if (in_array( $category->virtuemart_category_id, $parentCategories)) $active_menu = 'class="active"'; ?>
   <li <?php echo $active_menu ?>>
      <?php echo JHTML::link($caturl, $cattext); ?>
      <?php if ($category->childs ) { ?>
      <ul class="menu<?php echo $class_sfx; ?>">
         <?php
         foreach ($category->childs as $child) {
            $caturl = JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$child->virtuemart_category_id);
            $cattext = $child->category_name; ?>
            <li>
               <?php echo JHTML::link($caturl, $cattext); ?>
            </li>
         <?php } ?>
      </ul>
   <?php } ?>
   </li>
<?php } ?>