
Originally Posted by
Ajeh
It sounds like what you really want to do is not show the Empty Categories in the middle of the page ...
To do that, you can edit the module:
/includes/modules/category_row.php
and add the code in
RED:
Code:
// bof: hide empty categories
if (zen_count_products_in_category($categories->fields['categories_id']) == 0) {
// skip empty category
} else {
$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . ' ' . $countContentProduct . '</a>');
}
// bof: hide empty categories
$col ++;
if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {
NOTE: That other code I gave you is not a good solution at all for the Category Tabs, so I would remove it ...
Actually, I want to hide subcategories where all products are inactive and subcategories where no products are in them.
Didn't work...it hid the empty categories but it also hid some categories with products active. It also left random blank areas where categories should be.
The end of my categories_tab page code looks different than yours. . ' ' . $countContentProduct is missing right before </a>.
PHP Code:
$categories->fields['categories_name'] . '</a>');
$col ++;
if ($col > (MAX_DISPLAY_CATEGORIES_PER_ROW -1)) {
$col = 0;
$row ++;
}
$categories->MoveNext();
}
}
I don't know if that has anything to do with it since I'm no guru on this code.
Thanks again.
Bookmarks