Show all subcategories in box module for 2.3.1
#1
Posted 01 December 2010 - 03:41 AM
Right now, it only shows the subcategories for the selected category. I'd like it to show whether or not it is highlighted. There are contribs that do this for previous OScommerce versions, but if there's an easy way to do this with the new version module, that'd be nice.
Thanks all.
#2
Posted 02 December 2010 - 09:57 PM
#3
Posted 05 December 2010 - 04:07 AM
line 37
Change: if ($category_depth == 'nested') {
To: if ($category_depth == 'nested' && isset($HTTP_GET_VARS['cPath'])) {
application_top.php
line 437
Ch: $cPath = ''; to: $cPath = '22';
the second change forces the default to be show all categories.
the first change allows the default home page while showing all folders.
www.ColinGlover.com
#4
Posted 05 December 2010 - 02:12 PM
With your mod, the homepage will default to the category 22. But I would like categories 22 and 23 open on the homepage.
Further, I'd like those categories open to show their subcategories through out the entire site.
But for now, your mod is nice, clean and simple. And gets me about half way to where i want to be. Thank you.
#5
Posted 05 December 2010 - 08:05 PM
www.ColinGlover.com
#6
Posted 06 December 2010 - 01:29 AM
/includes/modules/boxes/bm_categories.php
around line 99
Find: $parent_id = $categories['categories_id']; Add: $dbs[] = $categories['categories_id'];
around line 109
change: while (list($key, $value) = each($cPath_array)) {
to: while (list($key, $value) = each($dbs)) {
PS: one is an addition, and one is a change.
Edited by derben, 06 December 2010 - 01:35 AM.
www.ColinGlover.com
#7
Posted 06 December 2010 - 07:47 PM
derben, on 06 December 2010 - 01:29 AM, said:
/includes/modules/boxes/bm_categories.php
around line 99
Find: $parent_id = $categories['categories_id']; Add: $dbs[] = $categories['categories_id'];
around line 109
change: while (list($key, $value) = each($cPath_array)) {
to: while (list($key, $value) = each($dbs)) {
PS: one is an addition, and one is a change.
This worked great on all pages, EXCEPT the "home" page (catalog)
thank you
#9
Posted 07 December 2010 - 03:18 AM
ErikMM, if you make the change to application_top.php to set the cPath to on of your categories, then it should work for your homepage as well.
Thanks, derben!
#10
Posted 08 December 2010 - 09:21 AM
derben, on 07 December 2010 - 03:11 AM, said:
1. index.php ~line 37
Change: if ($category_depth == 'nested') {
To: if ($category_depth == 'nested' && isset($HTTP_GET_VARS['cPath'])) {
2. catalog/application_top.php ~line 437Ch: $cPath = ''; to: $cPath = '22';3. includes/modules/boxes/bm_categories.php ~around line 99
Find: $parent_id = $categories['categories_id']; Add: $dbs[] = $categories['categories_id'];4.includes/modules/boxes/bm_categories.php ~around line 109
change: while (list($key, $value) = each($cPath_array)) {
to: while (list($key, $value) = each($dbs)) {
What goes in place of the '22'?
#11
Posted 08 December 2010 - 02:47 PM
Cheers.
#12
Posted 11 December 2010 - 04:14 AM
ErikMM, on 08 December 2010 - 09:21 AM, said:
Change: if ($category_depth == 'nested') {
To: if ($category_depth == 'nested' && isset($HTTP_GET_VARS['cPath'])) {
2. catalog/application_top.php ~line 437Change: $cPath = ''; to: $cPath = '22';3. includes/modules/boxes/bm_categories.php ~around line 99
Find: $parent_id = $categories['categories_id']; Add: $dbs[] = $categories['categories_id'];4.includes/modules/boxes/bm_categories.php ~around line 109
change: while (list($key, $value) = each($cPath_array)) {
to: while (list($key, $value) = each($dbs)) {
What goes in place of the '22'?
Where does it say to change a 22? Change the default '' (nothing) to '22'.
-DerBen
www.ColinGlover.com
#13
Posted 11 December 2010 - 06:39 AM
derben, on 11 December 2010 - 04:14 AM, said:
-DerBen
wiecek said "make the change to application_top.php to set the cPath to on of your categories, then it should work for your homepage as well"
this is also a little to cryptic for me as well-- call me dumb
Edited by ErikMM, 11 December 2010 - 06:49 AM.
#14
Posted 12 December 2010 - 05:31 AM
Just make the changes (all 4) exactly as I stated and it will work. I'm using it right now on my store, also it's confirmed by wiecek when he said it worked perfect for him too.
www.ColinGlover.com
#15
Posted 12 December 2010 - 02:55 PM
Only problem that I've encountered is that when you are on the page listing a nested category, category 22 becomes bold as well as the current nested category. But that's a relatively minor style issue.
#16
Posted 12 December 2010 - 07:47 PM
wiecek, on 12 December 2010 - 02:55 PM, said:
Only problem that I've encountered is that when you are on the page listing a nested category, category 22 becomes bold as well as the current nested category. But that's a relatively minor style issue.
Thanks again for this tip despite a little confusion on my part as to why "22."
#17
Posted 12 December 2010 - 09:06 PM
The reason that it's bold on the homepage is where the default category path on index.php is usually '' the change now makes it category '22' or whatever category that you want selected.
#18
Posted 05 February 2011 - 09:06 PM
I think I found a solution to the Home or Catalog bold issue:
$cPath = '0';
So far, looks good for me: all categories expanded but nothing in bold.
Edited by casaba, 05 February 2011 - 09:07 PM.
#19
Posted 05 February 2011 - 09:22 PM
Right now, I have two Categories, each with multiple subcategories.
Bold works fine when I select either Category or a subcategory within the first Category.
However, if I select a subcategory in the second Category, both Categories are displayed in bold.
(This is true even when I enter $cPath = '22';.)
Anybody else run into this? Any ideas?
#20
Posted 19 February 2011 - 09:33 PM
I use OSC 2.3.1, but for me don't work this solution.









