I've been at this all day and have tried everything I can think of or have dug up on the forums. For whatever reason, probably my lack of understanding, I just can't get the category tree to behave the way I need it to. Similar to CATTREE, I need it to display the parent categories on any page I have it and then only the subcategories for whatever parent is selected as you move down the tree. The catch that won't allow CATTREE to work is that I've set up a "Shop by Category" and "Shop by Brand" since I'll be using two category trees as illustrted below...
Shop by Category
Category One
-Subcat One
--Subsubcat One
Category Two
Shop by Brand
Brand One
Brand Two
Brand Three
I've managed to get it to function as desired down through 'Subcat One' but as soon as a 'Subsubcat' is selected the tree defaults back to showing only the top level categories (Category One, Category Two, etc.). I can see why it is doing it in the code but I can't figure out a way around it. Below is my starting point, or at least what I revert to when attempting the next change.
I'm really hoping someone can steer me in the right direction. I did think up a solution using CATTREE but it is ugly
and prone to major problems later on if categories are changed, which they most certainly will be.
Thanks,
Tim
Shop by Category
Category One
-Subcat One
--Subsubcat One
Category Two
Shop by Brand
Brand One
Brand Two
Brand Three
I've managed to get it to function as desired down through 'Subcat One' but as soon as a 'Subsubcat' is selected the tree defaults back to showing only the top level categories (Category One, Category Two, etc.). I can see why it is doing it in the code but I can't figure out a way around it. Below is my starting point, or at least what I revert to when attempting the next change.
Code:
<mvt:item name="toolkit" param="sassign|onecat|shop-categories" /> <mvt:item name="toolkit" param="subcat|ccount|g.onecat" /> <mvt:foreach iterator="sub_category" array="sub_categories"> <strong>&mvt:sub_category:name;</strong><br /> <mvt:if expr="g.Category_Code EQ l.settings:sub_category:code"> <mvt:item name="toolkit" param="subcat2|ccount2|l.all_settings:sub_category:code" /> <mvt:if expr="ccount2 GT 0"> <mvt:foreach iterator="sub_category2" array="sub_categories2"> - &mvt:sub_category2:name;<br /> <mvt:if expr="g.Category_Code EQ l.settings:sub_category2:code"> <mvt:item name="toolkit" param="subcat3|ccount3|l.all_settings:sub_category2:code" /> <mvt:if expr="ccount3 GT 0"> <mvt:foreach iterator="sub_category3" array="sub_categories3"> - - &mvt:sub_category3:name;<br /> </mvt:foreach> </mvt:if> </mvt:if> </mvt:foreach> </mvt:if> </mvt:if> </mvt:foreach>
and prone to major problems later on if categories are changed, which they most certainly will be.
Thanks,
Tim
Comment