Guest Posted October 4, 2005 Share Posted October 4, 2005 Using osC_Categories which works like a charm. My problem is that i like to disable/remove the links for categories which doesnt hold any products. I got around 750 categories and my products only recide in the third level of each category. For better understanding: Main and first subcategories should show up but shouldnt have a clickable link, only the last category should hold an clickable link. Anyone got an idea what needs to be tweaked in the categories.php to achieve that? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 4, 2005 Share Posted October 4, 2005 Just found the function "tep_count_products_in_category" which seems like it could be used to slove my problem. But i dont have an idea where to put it. Quote Link to comment Share on other sites More sharing options...
saigon Posted October 25, 2005 Share Posted October 25, 2005 installed this on my site and it's working great, however, I have a lot of subcatagories, and they're disapearing off the bottom of the page, is there any way of having the menu system provide 3 rows of 10 subcatagories for example rather than one long vertical list 3 horizontal lists if that makes any sense? Quote Link to comment Share on other sites More sharing options...
Rose Rose Posted November 1, 2005 Share Posted November 1, 2005 Using osC_Categories which works like a charm. My problem is that i like to disable/remove the links for categories which doesnt hold any products. I got around 750 categories and my products only recide in the third level of each category. For better understanding: Main and first subcategories should show up but shouldnt have a clickable link, only the last category should hold an clickable link. Anyone got an idea what needs to be tweaked in the categories.php to achieve that? Hello! Did you find a soltution yet? Please let me know! Thanks, Juan! Quote Link to comment Share on other sites More sharing options...
Patty Posted February 28, 2006 Share Posted February 28, 2006 Great contribution. Tks for making it available. :) One question: how to display the number of products in each category, like in the default menu? Tks in advance for any help. Quote Patty Link to comment Share on other sites More sharing options...
Patty Posted March 4, 2006 Share Posted March 4, 2006 Hello? Can somebody please give some help here? I think this should be an easy one. :blush: Product count is enabled on admin. How to show count on the menu? Quote Patty Link to comment Share on other sites More sharing options...
Guest Posted March 22, 2006 Share Posted March 22, 2006 can someone please advice how I can get this work using the following article contribution: http://www.oscommerce.com/community/contri...ll/search,tpath i've tried myself, but it seems to be well above my head! Quote Link to comment Share on other sites More sharing options...
Patty Posted July 20, 2006 Share Posted July 20, 2006 I'm still trying to find a way to show product count on the menu. Does anyone know how to do it?? Quote Patty Link to comment Share on other sites More sharing options...
randomone Posted September 11, 2006 Share Posted September 11, 2006 I'm still trying to find a way to show product count on the menu. Does anyone know how to do it?? I figured this out the other day. Open up "includes/classes/categories.php" and search for: // $title = "'" . addslashes($category['name']) . "$count'"; remove the // because it comments out the line. And add the // to the line below it. (Should be lines 73 and 74.) Also, delete the /* and */ on lines 62 and 69. Now it should display them. Has anyone else had an issue if you increase the font size? I'm using STS 4.1 and Infobox Skins Manager and if I up the font size (and/or use the above fix to show the numerb of products) I get a box that is larger than all the other boxes. It seems like the arrow images require a certain space between them and the categoryies name and I don't know where to change that value and remove the excess spaces at. Additionally, I'd like to know how or if its possible to change the color the category you are currently browsing? I'd like have a seperate style for it, but can't seem to get it to work, even if I encase the text in a span with its own style. :( Quote Link to comment Share on other sites More sharing options...
Patty Posted September 11, 2006 Share Posted September 11, 2006 I tried that many times before but it didn't work. I'm testing another menu similar to this one that seems to be able to show the count. Quote Patty Link to comment Share on other sites More sharing options...
randomone Posted September 13, 2006 Share Posted September 13, 2006 I tried that many times before but it didn't work.I'm testing another menu similar to this one that seems to be able to show the count. I've gone through and figured out how to both make it display the count number and remove any categories with zero products in them. In "catalog/includes/classes/categories.php" search for "function buildBranch($parent_id, $level = 0)" (should be around line 48) Replace the entire function with: function buildBranch($parent_id, $level = 0) { global $request_type; if (isset($this->data[$parent_id])) { foreach ($this->data[$parent_id] as $category_id => $category) { $products_in_category = tep_count_products_in_category($category_id); if($products_in_category != 0) { $category_link = $category_id; if (isset($this->data[$category_id])) { $result .= $this->parent_start_string; } else { $result .= $this->child_start_string; } if (SHOW_COUNTS == 'true') { $count = ' (' . $products_in_category . ')'; } $icon = "null"; $title = "'" . addslashes($category['name']) . "$count'"; // $title = "'" . addslashes($category['name']) . "'"; // $url = "'" . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link,$request_type) . "'"; $url = "'" . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $this->buildBreadcrumb($category_link),$request_type) . "'"; $target = "''"; $description = "''"; $result .= "$icon, $title, $url, $target, $description"; if (isset($this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level+1))) { $result .= ",".$this->buildBranch($category_id, $level+1); } if (isset($this->data[$category_id])) { $result .= $this->parent_end_string; } else { $result .= $this->child_end_string; } } } } return $result; } That works for me at least. Note that I also update my JSCookMenu file to v2.03, I don't think that should be an issue though. Got it working with STS, InfoboxSkins, CCGV, and various other modules... finally! :D Quote Link to comment Share on other sites More sharing options...
Patty Posted September 13, 2006 Share Posted September 13, 2006 randomone, you're a genius!!! That's it!!! Works like a charm!! :D Thank you so much! I've been looking for this solution for months!! Just one little thing: how to show the categories with 0 products? Most of my clients will want to show them even if there's nothing there. TIA. :) Quote Patty Link to comment Share on other sites More sharing options...
Patty Posted September 14, 2006 Share Posted September 14, 2006 I commented out if($products_in_category != 0) and now all categories are showing. Is that all?? :huh: Quote Patty Link to comment Share on other sites More sharing options...
randomone Posted October 14, 2006 Share Posted October 14, 2006 (edited) I commented out if($products_in_category != 0) and now all categories are showing. Is that all?? :huh: Yeah that is all. =) Anyone else having intermitent issues with the menu not being displayed? If you check out my website every once in a while the categories simply won't show up, but I'd say about 90% of the time they are perfectly fine. www.nmoutlet.com I have not been able to get get it to do this consistantly under any circimstances. The site was running a bit slow so we had our webhost try to 'fix' it. Trying to figure out if the 'fix' caused an issue with the menu system somehow or if anyone else has the same problem. Edited October 14, 2006 by randomone Quote Link to comment Share on other sites More sharing options...
Kawazu Posted February 2, 2007 Share Posted February 2, 2007 (edited) Hello, I was wondering if it would be possible to use the JSCookTree method (http://jscook.yuanheng.org/JSCookTree/index.html) as opposed to the JSCookMenu method (the one used here) by the same author. I'm redoing my site and the tree suits my needs much more than a fly-out, which I have right now. If it is possible, any help on how to implement it would be greatly appreciated because JavaScript is not exactly my forte. Thanks very much for your time. -Ian Edited February 2, 2007 by Kawazu Quote Ian Osos Web Developer Link to comment Share on other sites More sharing options...
Kawazu Posted February 2, 2007 Share Posted February 2, 2007 Nevermind, I think I've got it... or at least I'm pretty close to getting it. Quote Ian Osos Web Developer Link to comment Share on other sites More sharing options...
randomone Posted December 3, 2008 Share Posted December 3, 2008 Has anyone else gotten this to work with oscommerce-2.2rc2a? I installed this with STS 4.5.8, and it whenever I select anything I get an error: Fatal error: Call to a member function add_current_page() on a non-object in /var/www/osc/includes/application_top.php on line 313 The line is right where the paste an if/then clause, though removing the if/then and reverting to the original code pumped out the same error, except lin 312. It just doesn't seem to like the line: $navigation->add_current_page(); Quote Link to comment Share on other sites More sharing options...
Guest Posted December 9, 2008 Share Posted December 9, 2008 @randomone Try to change application_top.php // navigation history if (tep_session_is_registered('navigation')) { if (PHP_VERSION < 4) { $broken_navigation = $navigation; $navigation = new navigationHistory; $navigation->unserialize($broken_navigation); } else { $navigation = new navigationHistory; } } else { tep_session_register('navigation'); $navigation = new navigationHistory; } if($HTTP_GET_VARS['page'] <> 'javascript_categories') { $navigation->add_current_page(); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.