Forums / All Other Contributions/Addons / Simple Category Tree

Simple Category Tree

Views: 97,118

Results 81 to 100 of 249
22 Mar 2008, 10:06 PM
#81
danp avatar

danp

New Zenner

Join Date:
Mar 2008
Posts:
32
Plugin Contributions:
0

Simple Category Tree

Hi Yellow, I have successfully implemented your "all products in sub cats" mod and it works except for some very strange behaviour. I have one subcat below a top cat that does not expand or show subcat or products.

See my development site:
http://www.alwaysriding.co.uk/alwaysshop/index.php?main_page=index&cPath=1

The problem only occurs under SHOP FOR MEN > MOUNTAIN > subcats. It works fine for all other sub cats??

I have checked the database table and all looks fine. Also, I have left the zen cart categories sidebox in below so you can see the categories work.

Any ideas?

Thanks
DanP

22 Mar 2008, 10:17 PM
#82
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Simple Category Tree

I see this:
<!--

On your page, looks like something is wrong.
BTW, try to print out:
print_r($_SESSION['category_tree']->retrieve_deepest_level_children(14));
And see which cats are printed out.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

22 Mar 2008, 10:29 PM
#83
fightthefourwalls avatar

fightthefourwalls

New Zenner

Join Date:
Nov 2007
Posts:
57
Plugin Contributions:
0

Re: Simple Category Tree

Hey yellow1912,

Thanks heaps for this mod... about to install it now.

Thanks again!

22 Mar 2008, 11:50 PM
#84
danp avatar

danp

New Zenner

Join Date:
Mar 2008
Posts:
32
Plugin Contributions:
0

Re: Simple Category Tree

yellow1912:

I see this:
<!--

On your page, looks like something is wrong.
BTW, try to print out:
print_r($_SESSION['category_tree']->retrieve_deepest_level_children(14));
And see which cats are printed out.

Array ( [0] => 3 [1] => 4 [2] => 5 [3] => 6 [4] => 7 ) is printed out. Looks like something is broken. Checked database and all looks fine.

I have added the line on the site, take a look.

Thanks
Dan

22 Mar 2008, 11:51 PM
#85
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Simple Category Tree

Did you call the function build_deepest_level_children() before trying to retrieve?

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

23 Mar 2008, 12:15 AM
#86
danp avatar

danp

New Zenner

Join Date:
Mar 2008
Posts:
32
Plugin Contributions:
0

Re: Simple Category Tree

yellow1912:

Did you call the function build_deepest_level_children() before trying to retrieve?

No, but added it and made no difference! I am stumped!

DanP

23 Mar 2008, 12:17 AM
#87
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Simple Category Tree

Copy your code here. I really cant help if you just say you add it and I dont know if you did use the right code or not.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

23 Mar 2008, 12:24 AM
#88
danp avatar

danp

New Zenner

Join Date:
Mar 2008
Posts:
32
Plugin Contributions:
0

Re: Simple Category Tree

yellow1912:

Copy your code here. I really cant help if you just say you add it and I dont know if you did use the right code or not.

$_SESSION['category_tree']->build_deepest_level_children();
print_r($_SESSION['category_tree']->retrieve_deepest_level_children(14));

and in the sidebox

$_SESSION['category_tree']->build_deepest_level_children();
echo $_SESSION['category_tree']->build_category_string('ul', 'li', '<br>', $_GET['cPath'], 4, false, true) ;

Thanks, DanP

23 Mar 2008, 12:28 AM
#89
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Simple Category Tree

It is not built correctly for some reason.
Try to update to this:
https://svn.rubikintegration.com/zencart_mods/simple_categories_tree/includes/classes/simple_categories_tree.php

You can also PM the ftp info so I can take a look

DanP:

$_SESSION['category_tree']->build_deepest_level_children();
print_r($_SESSION['category_tree']->retrieve_deepest_level_children(14));

and in the sidebox

$_SESSION['category_tree']->build_deepest_level_children();
echo $_SESSION['category_tree']->build_category_string('ul', 'li', '<br>', $_GET['cPath'], 4, false, true) ;

Thanks, DanP

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

23 Mar 2008, 1:10 AM
#90
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Simple Category Tree

@DanP: fixed. That was indeed a bug.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

23 Mar 2008, 1:18 AM
#91
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Simple Category Tree

Fixed version uploaded. For those who already installed, all you need to do is to over-write the file inside includes/classes

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

23 Mar 2008, 4:48 PM
#92
danp avatar

danp

New Zenner

Join Date:
Mar 2008
Posts:
32
Plugin Contributions:
0

Re: Simple Category Tree

yellow1912:

@DanP: fixed. That was indeed a bug.

Hi yellow1912, thanks for the help and bug fix, much appreciated.

DanP

23 Mar 2008, 7:57 PM
#93
danp avatar

danp

New Zenner

Join Date:
Mar 2008
Posts:
32
Plugin Contributions:
0

Re: Simple Category Tree

Hi again Yellow1912,

Would it be possible to be fix the subcat level from where the tree starts instead of it using the current level. So it is always present from the same subcat level.

I also need to combine subcategories (and list products under these) of the same name within other subcats when "ALL STYLES" is selected, e.g. same subcat structure as required above with 'headwear' from 'road', 'mountain', 'commute' combined. Would this be possible with your class? e.g. Image attached.

Thanks
DanP

25 Mar 2008, 8:14 PM
#94
danp avatar

danp

New Zenner

Join Date:
Mar 2008
Posts:
32
Plugin Contributions:
0

Re: Simple Category Tree

Hi, anyone using this contrib. managed to get the parent style to flag as "current" when a sub-cat is enabled as current in class?

Thanks
DanP

26 Mar 2008, 9:04 PM
#95
noella avatar

noella

New Zenner

Join Date:
Oct 2005
Posts:
71
Plugin Contributions:
0

Re: Simple Category Tree

thank you very much! got it working!

26 Mar 2008, 9:33 PM
#96
danp avatar

danp

New Zenner

Join Date:
Mar 2008
Posts:
32
Plugin Contributions:
0

Re: Simple Category Tree

Hi yellow, there appears to be another bug. Only occurs on the first subcat under each of the subcats 'headwear, bodywear, legwear, footwear, accessories' under 'shop for men'

E.g. Buffs, gloves, does not return the full cPath for the link.

see http://www.alwaysriding.co.uk/alwaysshop/index.php?main_page=index&cPath=1_14

Tried to find the problem, but can't spot it.

Thanks
DanP

17 Apr 2008, 8:22 AM
#97
focus360 avatar

focus360

New Zenner

Join Date:
May 2006
Posts:
76
Plugin Contributions:
0

Re: Simple Category Tree

Thanks for the mods, I have been playing around with them on a test site and they are great. I see many uses!

I currently have the following code in my cat tree:

<?php
$content = '';
  if($cPath == 3)
     $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath'], 1); 
  elseif($cPath == 2)
     $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath'], 1); 
  else
     $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 0, 2);  

?>

This shows either the top 2 categories. OR for cPath 2 and cPath3 it shows just the subcategories in this.

Is it possible to extend this so that cPath 2_549_651 and cPath 2_549_652 and cPath 2_549_653 (for example) shows the categories in cPath 2_549.

I have tried adding this code to my initial code:

<?php
$content = '';
  elseif($cPath == 2_549)
     $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 549, 1);

I have also tried:

<?php
$content = '';
  elseif($cPath == 549)
     $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 549, 1);

None of these work and it is still been controlled by the initial elseif cpath 2 statement.

Any ideas what I am on about and it is possible to achieve my desired result?

17 Apr 2008, 12:20 PM
#98
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Simple Category Tree

May look a bit weird at first, but have you tried:
if(in_array(549, explode('_',$_GET['cPath'])))

Remember, $_GET['cPath'] is a string that can be 2_549, 549, or 2_549_653 etc....

There is a better way to do it tho, but lets try this for now.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

18 Apr 2008, 7:28 AM
#99
focus360 avatar

focus360

New Zenner

Join Date:
May 2006
Posts:
76
Plugin Contributions:
0

Re: Simple Category Tree

This works a treat! Ive got my categories looking exactly as I want.

My my categories sidebox template looks something like this:

<?php
$content = '';
  if(in_array(16, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 16, 2);
  elseif(in_array(11, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 11, 2);
  elseif(in_array(12, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 12, 2);
  elseif(in_array(13, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 13, 2);
  elseif(in_array(14, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 14, 2);
  elseif(in_array(15, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 15, 2);
  elseif(in_array(17, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 17, 2);
  elseif(in_array(18, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 18, 2);
  elseif(in_array(19, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 19, 2);
  elseif(in_array(20, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 20, 2);
  elseif(in_array(21, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 21, 2);
  elseif(in_array(22, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 22, 2);
  elseif(in_array(23, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 23, 2);
  elseif(in_array(24, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 24, 2);
  elseif(in_array(25, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 25, 2);
  elseif(in_array(26, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 26, 2);
  elseif(in_array(27, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 27, 2);
  elseif(in_array(28, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 28, 2);
  elseif(in_array(29, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 29, 2);
  elseif(in_array(30, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 29, 2);
  elseif(in_array(31, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 31, 2);
  elseif(in_array(32, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 32, 2);
  elseif(in_array(33, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 33, 2);
  elseif(in_array(34, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 34, 2);
  elseif(in_array(35, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 35, 2);
  elseif(in_array(36, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 36, 2);
  elseif(in_array(37, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 37, 2);
  elseif(in_array(38, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 38, 2);
  elseif(in_array(7, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 7, 2);
  elseif(in_array(65, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 65, 2);
  elseif(in_array(984, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 984, 2); 
  elseif(in_array(9, explode('_',$_GET['cPath'])))
  	 $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 9, 3);
  elseif($cPath == 3)
     $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath'], 1); 
  elseif($cPath == 2)
     $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', $_GET['cPath'], 1);
  else
     $content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 0, 2);  

?>

As a php novice using probably too many statements that is required to do the job. Will all these statements put an unnecessary load on the server? (as there will be a few more).

18 Apr 2008, 7:29 AM
#100
moni avatar

moni

New Zenner

Join Date:
Apr 2008
Posts:
19
Plugin Contributions:
0

Re: Simple Category Tree

Hello ....

I am also trying to make categories and subcategory listing on lext side box...
I have used ur code but im not getting out put..
one thing.... im not clear where to include the simple_categories_tree_generator.php and config.simple_categories_tree_generator.php .
I have place them as u have redirect but still not getting out put...
can u please tell me proper flow of ur code what should i change n what i should add ?
please reply me on my e-id : [email protected]