News:

Support the VirtueMart project and become a member

Main Menu

Category module

Started by maxi1973, April 04, 2013, 16:38:02 PM

Previous topic - Next topic

maxi1973

Hello, i've installed VM 2.0.20 an a joomla 2.5.9 website. Everything is ok apart a little trouble i have.
In the Categories module i can see main category and only one subcategory as expandible... if subcategory contains sub-subcategories those aren't show correctly in the module.
As you cann see in attached photo, "arredamento acquario" has subcategories, but those aren't shown (with the down arrow) in the subcategory mentioned. Thanks a lot to everyone can help me. Here the code of /modules/mod_virtuemart_category/tmpl/default.php


<?php // no direct access
defined('_JEXEC') or die('Restricted access');
//JHTML::stylesheet ( 'menucss.css', 'modules/mod_virtuemart_category/css/', false );

/* ID for jQuery dropdown */
$ID str_replace('.''_'substr(microtime(true), -88));
$js="
//<![CDATA[
jQuery(document).ready(function() {
jQuery('#VMmenu"
.$ID." li.VmClose ul').hide();
jQuery('#VMmenu"
.$ID." li .VmArrowdown').click(
function() {

if (jQuery(this).parent().next('ul').is(':hidden')) {
jQuery('#VMmenu"
.$ID." ul:visible').delay(500).slideUp(500,'linear').parents('li').addClass('VmClose').removeClass('VmOpen');
jQuery(this).parent().next('ul').slideDown(500,'linear');
jQuery(this).parents('li').addClass('VmOpen').removeClass('VmClose');
}
});
});
//]]>
;

$document JFactory::getDocument();
$document->addScriptDeclaration($js);?>


<ul class="VMmenu<?php echo $class_sfx ?>" id="<?php echo "VMmenu".$ID ?>" >
<?php foreach ($categories as $category) {
 $active_menu 'class="VmClose"';
$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="VmOpen"';

?>


<li <?php echo $active_menu ?>>
<div >
<?php echo JHTML::link($caturl$cattext);
if ($category->childs) {
?>

<span class="VmArrowdown"> </span>
<?php
}
?>

</div>
<?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>
<div ><?php echo JHTML::link($caturl$cattext); ?></div>
</li>
<?php } ?>
</ul>
<?php  ?>
</li>
<?php
?>

</ul>


[attachment cleanup by admin]