Fixed version uploaded. For those who already installed, all you need to do is to over-write the file inside includes/classes
Printable View
Fixed version uploaded. For those who already installed, all you need to do is to over-write the file inside includes/classes
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
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
thank you very much! got it working!
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/always...dex&cPath=1_14
Tried to find the problem, but can't spot it.
Thanks
DanP
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:
This shows either the top 2 categories. OR for cPath 2 and cPath3 it shows just the subcategories in this.HTML Code:<?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);
?>
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:
I have also tried:HTML Code:<?php
$content = '';
elseif($cPath == 2_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.HTML Code:<?php
$content = '';
elseif($cPath == 549)
$content .= $_SESSION['category_tree']->build_category_string('ul', 'li', '', 549, 1);
Any ideas what I am on about and it is possible to achieve my desired result?
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.
This works a treat! Ive got my categories looking exactly as I want.
My my categories sidebox template looks something like this:
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).HTML Code:<?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);
?>
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 : anupama@iksula.com