thanks for your solution , is great, but there is one more thing.
the mod_tpindexvm does not count all items inside categories and subcategories.
can you help us on what to change in the mod?
the code in default.php is this:
<?php
/**
* TemplatePlazza
* TemplatePlazza.com
**/
defined('_JEXEC') or die('Restricted access');
$menu = &JSite::getMenu();
$items = $menu->getItems('link', 'index.php?option=com_virtuemart');
$itemid = isset($items[0]) ? '&Itemid='.$items[0]->id : '';
$modtype = $params->get('modtype');
$showtitle = $params->get('showtitle');
$showdesc = $params->get('showdesc');
$showsubcat = $params->get('showsubcat');
$showthumb = $params->get('showthumb');
$col = $params->get ('num_cols', 2);
$colwidth = floor(100/$col);
$x = 0;
$y = 1;
$row = ceil(count($list)/$col);
$total = $col*$row;
$rest = ($total-count($list))+1;
if($modtype == 0){
$headtag = "<link rel=\"stylesheet\" href=\"" . JURI::root() . "/modules/mod_tpindexvm/tmpl/tpindexvm.css\" type=\"text/css\" />";
}else{
$headtag = "<link rel=\"stylesheet\" href=\"" . JURI::root() . "/modules/mod_tpindexvm/tmpl/tpindexvm_menu.css\" type=\"text/css\" />";
}
$mainframe->addCustomHeadTag($headtag);
if($list){
if($modtype == 0){
$data = "<div class=\"productthumb\">";
$data .= '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
for($a=0; $a<$total; $a++){
if($y == 1){
$data .= '<tr valign="top"><td width="' . $colwidth . '%">';
}else{
$data .= '<td width="' . $colwidth . '%">';
}
if(isset($list[$a]->id)){
$linkp = JRoute::_('index.php?option=com_virtuemart&page=shop.browse&category_id='.$list[$a]->id.$itemid, false);
$data .= "<div class=\"pthumb\">";
if($showthumb == 1){
$class = " bbb";
}else{
$class = "";
}
if($showtitle == 1){
$data .= "<a href=\"$linkp\" title=\"" . $list[$a]->name . "\" id=\"productthumbbig$x\" class=\"productthumbbigtitle\">";
$data .= "<span>" . $list[$a]->name . "</span>";
$data .= "</a>";
}
if($showthumb == 1){
$data .= "<a href=\"$linkp\" title=\"" . $list[$a]->name . "\" id=\"productthumbbig$x\" class=\"productthumbbig\">";
$data .= "<div class=\"pthumbimg\"><img src='" . JURI::base(true) . "/components/com_virtuemart/shop_image/category/" . $list[$a]->filename . "' /></div>";
$data .= "</a>";
}
if($showdesc == 1 || $showsubcat == 1){
$data .= "<div class='detail" . $class . "'>";
if($showdesc == 1){ $data .= "<div class='desc'>" . $list[$a]->desc . "</div>";}
if($showsubcat == 1){
$child = modTPIndexHelper::getListChild($params, $list[$a]->id);
if(count($child) > 0){
$data .= "<ul>";
for($i=0; $i<count($child); $i++){
$linkc = JRoute::_('index.php?option=com_virtuemart&page=shop.browse&category_id='.$child[$i]->id.$itemid, false);
$data .= "<li><a href=\"$linkc\" title=\"" . $child[$i]->name . "\">" . $child[$i]->name . " (" . number_format($child[$i]->total, 0, "", ".") . ")</a></li>";
}
$data .= "</ul>";
}
}
$data .= "</div>";
$data .= "<div class='clear'></div>";
}
$data .= "</div>";
}else{
$data .= " ";
}
$x++;
if($y == $col){
$data .= '</td></tr>';
$y = 1;
}else{
$data .= '</td>';
$y++;
}
}
$data .= "</table>";
}else{
$data = "<div class=\"productthumb_menu\">";
$data .= '<ul class="parent">';
for($a=0; $a<$total; $a++){
if(isset($list[$a]->id)){
$data .= '<li>';
$linkp = JRoute::_('index.php?option=com_virtuemart&page=shop.browse&category_id='.$list[$a]->id.$itemid, false);
$data .= "<div class=\"pthumb\">";
if($showthumb == 1){
$class = " bbb";
}else{
$class = "";
}
$data .= "<a href=\"$linkp\" title=\"" . $list[$a]->name . "\" id=\"productthumbbig$x\" class=\"productthumbbigtitle\">";
$data .= "<span>" . $list[$a]->name . "</span>";
$data .= "</a>";
if($showthumb == 1){
$data .= "<a href=\"$linkp\" title=\"" . $list[$a]->name . "\" id=\"productthumbbig$x\" class=\"productthumbbig\">";
$data .= "<img src='" . JURI::base(true) . "/components/com_virtuemart/shop_image/category/" . $list[$a]->filename . "' />";
$data .= "</a>";
}
if($showdesc == 1 || $showsubcat == 1){
$data .= "<div class='detail" . $class . "'>";
if($showdesc == 1){ $data .= "<div class='desc'>" . $list[$a]->desc . "</div>";}
if($showsubcat == 1){
$child = modTPIndexHelper::getListChild($params, $list[$a]->id);
if(count($child) > 0){
$data .= "<ul>";
for($i=0; $i<count($child); $i++){
$linkc = JRoute::_('index.php?option=com_virtuemart&page=shop.browse&category_id='.$child[$i]->id.$itemid, false);
$data .= "<li><a href=\"$linkc\" title=\"" . $child[$i]->name . "\">" . $child[$i]->name . " (" . number_format($child[$i]->total, 0, "", ".") . ")</a></li>";
}
$data .= "</ul>";
}
}
$data .= "</div>";
$data .= "<div class='clear'></div>";
}
$data .= "</div>";
$data .= '</li>';
}
$x++;
}
$data .= "</ul>";
}
$data .= "</div>";
}else{
$data = "";
}
echo $data;
?>