I have search and haven't found the answer. I seems very simple but I am stumped. I would like users to be able to click on a category and go straight to all the listings in that category eliminating the subcategories page.
I have search and haven't found the answer. I seems very simple but I am stumped. I would like users to be able to click on a category and go straight to all the listings in that category eliminating the subcategories page.
bump... i want to know, too!
Then why do you have subcategories in that category?
i'm using the css dropdown menu, and want to force people to choose subcategories there. i don't want to have the option to click on the main category name to bring you to the subcategory listing pages at all. would appreciate any help - this is making me crazy!
maybe my issue is a little different from the original poster.....
OK, so what you want is essentially to make the top category buttons in the dropdown to be not links. That should be possible with some logic added to tpl_drop_menu.php (I think that's the file). I can take a look at it, but it may be a few days before I have time to get into it.
that's exactly it - you stated it much more eloquently than i did!
i truly do appreciate any help. as i said, this has been totally driving me crazy!
There are at least a couple of dropdown menu mods in Free Addons, so I would need to know exactly which one you are using before trying to modify files.
http://www.zen-cart.com/forum/showthread.php?t=58629
^^ this one.
thanks again!
tpl_drop_menu.php just calls /includes/classes/categories_ul_generator.php, and applies a few cryptic transformations to its output (for the categories part of the menu). It might be possible to intercept and alter the right one of those, but more likely the class will have to be edited. I would suggest you check with Jade (jettrue) in the support thread about this. Meanwhile, I'll take a look at it, but I make no promises for quick results.
Add as shown in red to two lines:PHP Code:
function buildBranch($parent_id, $level, $submenu=true, $parent_link='')
{
$result = sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' : '' );
if (($this->data[$parent_id])) {
foreach($this->data[$parent_id] as $category_id => $category) {
$category_link = $parent_link . $category_id;
if (($this->data[$category_id])) {
$result .= sprintf($this->child_start_string, ($submenu==true) ? ' class="submenu"' : '');
} else {
$result .= sprintf($this->child_start_string, '');
}
//$result .= str_repeat($this->spacer_string, $this->spacer_multiplier * 1) . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">';
$result .= str_repeat($this->spacer_string, $this->spacer_multiplier * 1) . ($parent_link? '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">': '');
$result .= $category['name'];
//$result .= '</a>';
$result .= ($parent_link? '</a>': '');
if (($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) {
$result .= $this->buildBranch($category_id, $level+1, $submenu, $category_link . '_');
}
$result .= $this->child_end_string;
}
}
$result .= $this->parent_group_end_string;
return $result;
}
($parent_link? '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">': '')
($parent_link? '</a>': '')
This will disable the link if $parent_link is blank (the current category is a top category).
Please test and let me know how it works for you. If you have sub-subcats, this would not disable links on their parents (subcats). That would require a different approach, but might be achievable without much more complexity.
Bookmarks