VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: stevennestler on November 18, 2011, 13:49:57 PM

Title: sub-categories possible?
Post by: stevennestler on November 18, 2011, 13:49:57 PM
Is it possible to have sub-categories?
Thanks,
Steven
Title: Re: sub-categories possible?
Post by: PRO on November 18, 2011, 14:18:55 PM
ofcourse
Title: Re: sub-categories possible?
Post by: rooney on December 30, 2011, 09:43:42 AM
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.
Title: Re: sub-categories possible?
Post by: jenkinhill on December 30, 2011, 10:56:12 AM
When entering your new category under Details / Category Ordering  select the second (third or fourth) category below which the new one should sit.
Title: Re: sub-categories possible?
Post by: rooney on December 30, 2011, 11:38:55 AM
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 } ?>