Re: Category Drop Down SELECT Menu Sidebox Mod.
Quote:
Originally Posted by
Rookie gone MAD!
Hi!
i want to use the categories_select side box module but would like to know how to add the new products, all products, featured products and specials, ect links like on the standard catagories list?
also i want to be able to switch the subcatagories off?
can anyone help PLEASE?
I've got the fix for people who want NO SUB CATEGORIES showing in their drop down menu.
First, open up includes/functions/functions_categories.php
Save a backup, as this is a core override, and there is no override folder for function files.
Then add this new function:
Code:
function zen_get_categories_no_sub($categories_array = '', $parent_id = '0', $indent = '', $status_setting = '') {
global $db;
if (!is_array($categories_array)) $categories_array = array();
// show based on status
if ($status_setting != '') {
$zc_status = " c.categories_status='" . (int)$status_setting . "' and ";
} else {
$zc_status = '';
}
$categories_query = "select c.categories_id, cd.categories_name, c.categories_status
from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where " . $zc_status . "
parent_id = '" . (int)$parent_id . "'
and c.categories_id = cd.categories_id
and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
order by sort_order, cd.categories_name";
$categories = $db->Execute($categories_query);
while (!$categories->EOF) {
$categories_array[] = array('id' => $categories->fields['categories_id'],
'text' => $indent . $categories->fields['categories_name']);
$categories->MoveNext();
}
return $categories_array;
}
////
You can add it wherever you want, I added it right after the code for function zen_get_categories.
Now open up includes/templates/YOUR_TEMPLATE/sideboxes/tpl_categories_select.php
and change:
zen_get_categories
to
zen_get_categories_no_sub
VOILA!
Re: Category Drop Down SELECT Menu Sidebox Mod.
:clap::clap::clap::clap:
i havnt had time to try this yet but if it works . . . . oh. . . i could kiss you :ohmy:
:blush: WOOOOOOooooooooooooo! GOD im happy NOW :D
Re: Category Drop Down SELECT Menu Sidebox Mod.
Quote:
Originally Posted by
Rookie gone MAD!
:clap::clap::clap::clap:
i havnt had time to try this yet but if it works . . . . oh. . . i could kiss you :ohmy:
:blush: WOOOOOOooooooooooooo! GOD im happy NOW :D
Just let me know how it works for you, it worked on my test site.
Re: Category Drop Down SELECT Menu Sidebox Mod.
Quote:
Originally Posted by
jettrue
Just let me know how it works for you, it worked on my test site.
THANKS :D
its worked amazingly :clap:
YOU'RE AWSOME! :jump:
:thumbsup: THANKS AGAIN :thumbsup:
Re: Category Drop Down SELECT Menu Sidebox Mod.
Does the above remove ALL subcategories? I actually just want to display parent, and subcategories, but not any of the sub categories child categories. Any thoughts?
Re: Category Drop Down SELECT Menu Sidebox Mod.
Quote:
Originally Posted by
magneteye
Does the above remove ALL subcategories? I actually just want to display parent, and subcategories, but not any of the sub categories child categories. Any thoughts?
Sorry, its either one or the other....
Re: Category Drop Down SELECT Menu Sidebox Mod.
Hi!
I have tried searching for this, but i get no matches. So i'm sorry if this is a second request...
Do you have a sulotion for highlighting the selected parent category? So when i am at the home page, the home "button" stays selected and when i browse a category, the top level category stays selected in the menu?
THanks!
Grtz Lenny
Re: Category Drop Down SELECT Menu Sidebox Mod.
Quote:
Originally Posted by
magneteye
Does the above remove ALL subcategories? I actually just want to display parent, and subcategories, but not any of the sub categories child categories. Any thoughts?
You could try this:
in tpl_drop_menu.php
comment out in this section:
PHP Code:
require_once (DIR_WS_CLASSES . 'categories_ul_generator.php');
$zen_CategoriesUL = new zen_categories_ul_generator;
$menulist = $zen_CategoriesUL->buildTree(true);
$menulist = str_replace('"level4"','"level5"',$menulist);
$menulist = str_replace('"level3"','"level4"',$menulist);
$menulist = str_replace('"level2"','"level3"',$menulist);
$menulist = str_replace('"level1"','"level2"',$menulist);
these lines:
PHP Code:
require_once (DIR_WS_CLASSES . 'categories_ul_generator.php');
$zen_CategoriesUL = new zen_categories_ul_generator;
$menulist = $zen_CategoriesUL->buildTree(true);
//$menulist = str_replace('"level4"','"level5"',$menulist);
//$menulist = str_replace('"level3"','"level4"',$menulist);
//$menulist = str_replace('"level2"','"level3"',$menulist);
$menulist = str_replace('"level1"','"level2"',$menulist);
If this is a subcategory to many, remove the //from the lowest of 3 lines.
Works for me.
just a note: this is without the new function. Just the original files.
Re: Category Drop Down SELECT Menu Sidebox Mod.
Quote:
Originally Posted by
lenny
Hi!
I have tried searching for this, but i get no matches. So i'm sorry if this is a second request...
Do you have a sulotion for highlighting the selected parent category? So when i am at the home page, the home "button" stays selected and when i browse a category, the top level category stays selected in the menu?
THanks!
Grtz Lenny
No, sorry, I don't.
Re: Category Drop Down SELECT Menu Sidebox Mod. HELP NEEDED for Firefox error
This mod is absoutely fab and really easy to install so firstly thankyou very much!
i have installed it fine and in internet exploder7 it looks great, however if i test it on my mac or my pc using firefox, the css formatting is completely ignored for the menu and it blows the layout all over the place
i saw a post where a user seemed to have a simliar problem - but there was no reply. apologies if this has already been asnwered -
www.ppekit.co.uk.
I'd be really grateful for your help on this, hoping to get the site live shortly and i'd like to iron out all the blips before i present to my client.
thanks
sarah