Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Fancy Cats - Trying to show ALL cats + subcats by default

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 08-13-2004, 10:05 AM
 
pipercub pipercub is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 82
 

Default Fancy Cats - Trying to show ALL cats + subcats by default

Boy, I didn't think this task would be so involved! What I'm trying to do is to create a category driectory which shows all Main Cats as well as Sub Cats without the need to 'expand'. I got this to work (kinda) without the fancy cats add-on, but it displayed my sub cats weird.

So anyway, I purchased the Fancy Cats Add-On in hopes of making life simple. Well, I could do exactly what I need to do if I could only get the 'Catagories' menu to show the entire expanded category 'tree' by default.

Has anyone attempted this?

Thanks,
Piper
__________________
x-cart 3.4.4 (UNIX)
Reply With Quote
  #2  
Old 08-16-2004, 12:31 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

instead of looping {$categories} in categories.tpl loop through {$allcategories} instead
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 08-25-2004, 03:54 AM
 
pipercub pipercub is offline
 

Advanced Member
  
Join Date: Oct 2002
Posts: 82
 

Default

Quote:
Originally Posted by shan
instead of looping {$categories} in categories.tpl loop through {$allcategories} instead

Shan, that worked very well, but It does not give me the control over the appearance of the cats & sub cats like I need. The mod will display like this:

Cat 1
Sub cat 1a
Sub cat 1b
Sub cat 1c
Cat 2
sub cat 2a
sub cat 2b
sub cat 2c
Cat 3
sub cat 3a
sub cat 3b
sub cat 3c

However, I really need to have controll over the look of the categories vs. the sub catagories. In other words, lets say I want to have all of the categories show up in a 14pt Bold typeface, but I want all of the sub cats to be 12pt regular. I know this can be done via CSS, but because I am currently looping the entire list as shown above, I have no control over those parameters.

That's why I bought the Fancy Categories module. I had hoped that I would gain control over the styles of the cats vs the sub cats. With Fancy Cats, I was able to display all of the cats & sub cats by default (with control over the styles), but when the user clicks on a sub cat, the list doubles up on the sub cats for the parent. Like this: (this is what I get when you click on a sub cat. In this case, it could have been 1a, 1b or 1c)

Cat 1
Sub cat 1a
Sub cat 1b
Sub cat 1c
Sub cat 1a
Sub cat 1b
Sub cat 1c
Cat 2
sub cat 2a
sub cat 2b
sub cat 2c
Cat 3
sub cat 3a
sub cat 3b
sub cat 3c

I am still trying to figure this out so if anyone has any input, please chime in!

Thanks,
Piper
__________________
x-cart 3.4.4 (UNIX)
Reply With Quote
  #4  
Old 08-25-2004, 04:41 AM
 
PoloJohn PoloJohn is offline
 

Member
  
Join Date: Aug 2004
Posts: 14
 

Default

sorry to hijack but to list catergories like this

Main
Sub A
Sub B
SubC
Main 2
Main 3

so that the active one shows the sub cats then what wud i need to do, heres my code

Quote:
{* $Id: categories.tpl,v 1.23 2004/06/24 09:53:29 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"}
{else}
{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
<FONT class="CategoriesList">{$categories[cat_num].category}</FONT>

{/section}
{else} {section name=cat_num loop=$subcategories}
<FONT class="CategoriesList">{$subcategories[cat_num].category}</FONT>

{/section}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }
__________________
www.anything-cars.com
Reply With Quote
  #5  
Old 09-29-2005, 12:38 PM
 
abcohen abcohen is offline
 

Newbie
  
Join Date: Sep 2005
Posts: 3
 

Default

but this still doesnt anwser the Fancy Categories, if you have say something like Paper product and then lots of sub categories how do you auto expand the fancy categories explorer theme to default show the first round of Subcategories...
__________________
Catalyst
Reply With Quote
  #6  
Old 11-07-2005, 12:01 PM
 
abcohen abcohen is offline
 

Newbie
  
Join Date: Sep 2005
Posts: 3
 

Default

I had posted this over a month ago with no reply... so I'd like to try again... I'm using fancy categories...

Right now when you see my cart its like this...

+ Categorie1


What I want to have is if no products are listed in it then to expand to show the subcategories ie

- Categorie1
+ subcat1
+ subcat2

did anyone hack the fancy categories to do this... or can help me out. thanks.
__________________
Catalyst
Reply With Quote
  #7  
Old 11-07-2005, 12:21 PM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

Forget Fancy Categories.
  • Causes Code Bloat
  • Will not really accomplish what you need

If all you have is two levels (category and category///subcategory) then try this code:

Code:
{section name=cat_num loop=$allcategories} {if $allcategories[cat_num].parentid eq 0} <font class="CategoriesList">{$allcategories[cat_num].category}</font> {/if} {if $allcategories[cat_num].subcategory_count gt 0} {section name=sub_num loop=$allcategories} {if $allcategories[sub_num].parentid eq $allcategories[cat_num].categoryid} <font class="SubCategoriesList"> - {$allcategories[sub_num].category}</font> {/if} {/section} {/if} {/section}

You will need to define the two classes used (CategoriesList and SubCategoriesList) in your CSS file.
Reply With Quote
  #8  
Old 11-17-2005, 02:00 PM
 
ming_wistongroup ming_wistongroup is offline
 

Newbie
  
Join Date: Oct 2005
Posts: 3
 

Default

Inspire of TelaFirma's code and combine with Fancy Cat: Explorer mod, here is my hack:

fancy_categories.tpl
Code:
{* $Id: fancy_categories.tpl,v 1.9.2.8 2005/11/17 12:43:30 ming Exp $ *} {assign var="rootcounter" value="0"}<SPAN class="VertMenuItems"> {foreach from=$allcategories item="category" key="categoryidx"} {if $category.depth eq "0"} {if $fancy_categories_variable_nowrap_categories eq "Y"}<NOBR>{/if}{$category.category|escape}{if $fancy_categories_variable_nowrap_categories eq "Y"}</NOBR>{/if} {if $category.expanded ne "0" || $fancy_categories_variable_full_js eq "Y"} {assign var="next_last_in_chain" value=$last_in_chain} {if $rootcounter eq $allcategoriesroot} {assign_ext var="next_last_in_chain[]" value="Y"} {else} {assign_ext var="next_last_in_chain[]" value="N"} {/if} {include file="`$fancycategories_config.modules_path`/fancy_subcategories.tpl" parencategory=$category.categoryid last_in_chain=$next_last_in_chain} {/if} {/if} {/foreach} </SPAN>

fancy_subcategories.tpl
Code:
{* $Id: fancy_subcategories.tpl,v 1.9.2.7 2005/11/17 12:43:30 ming Exp $ *} {if $parencategory ne "0"} {foreach from=$allcategories item="category" key="categoryidx"} {if $category.categoryid eq $parencategory} {math equation="x+1" x=$category.depth assign="indent"} {assign var="rootcounter" value="0"} {foreach from=$category.childcategoryidx item="chcategory" key="chcategoryidx"} {math equation="x+1" x=$rootcounter assign="rootcounter"} {section name=indentsteps loop=$last_in_chain}{/section} {if $allcategories[$chcategory].subcategory_count gt 0}{if $fancy_categories_variable_nowrap_categories eq "Y"}<NOBR>{/if}{$allcategories[$chcategory].category|escape}{if $fancy_categories_variable_nowrap_categories eq "Y"}</NOBR>{/if} {else} {if $fancy_categories_variable_nowrap_categories eq "Y"}<NOBR>{/if}{$allcategories[$chcategory].category|escape}{if $fancy_categories_variable_nowrap_categories eq "Y"}</NOBR>{/if} {/if} {if $allcategories[$chcategory].expanded ne "0" || $fancy_categories_variable_full_js eq "Y"} {assign var="next_last_in_chain" value=$last_in_chain} {if $rootcounter eq $category.childcategory_number} {assign_ext var="next_last_in_chain[]" value="Y"} {else} {assign_ext var="next_last_in_chain[]" value="N"} {/if} {include file="`$fancycategories_config.modules_path`/fancy_subcategories.tpl" parencategory=$allcategories[$chcategory].categoryid last_in_chain=$next_last_in_chain} {/if} {/foreach} {/if} {/foreach} {/if}

Note 1: Icon indent does not support.
Note 2: I feel dumb since I modified a bloat-code. It's not innovation...
Note 3: If you'd like to see what it looks like, goto: http://www.wgdirect.com
__________________
Flora Li
----------
WGDirect
http://www.wgdirect.com
Reply With Quote
  #9  
Old 01-30-2006, 03:33 AM
  Raptor's Avatar 
Raptor Raptor is offline
 

Senior Member
  
Join Date: Jan 2006
Posts: 131
 

Default

Is there any way to show all categories and sub categories but not sub categories of sub categories.

So basically it shows...

Main 1
- Sub 1
- Sub 2
- Sub 3

Instead of...

Main 1
- Sub 1
- Sub Sub 1
- Sub Sub 2
- Sub 2
- Sub 3
__________________
X-Cart Gold Plus v4.7.12
ReBOOT ReDUX Theme
Reply With Quote
  #10  
Old 10-18-2006, 11:11 PM
 
wildelectronics wildelectronics is offline
 

Member
  
Join Date: Apr 2004
Location: Sydney Australia
Posts: 21
 

Default Re: Fancy Cats - Trying to show ALL cats + subcats by default

Hi, I tried this mod with some serious problems.

Please see www.wildelectronics.com.au/store/customer

First of all, the categories are back to the way they used to be, with "Gifts for him/Her" in the left menu. They were previously invisible there, only to be in the GIFT section.

Also, when you click into a category, you'll notice the words up top are screwed up.

Does anyone know how I can restore this?

Regards Kurt
X-Cart 3.5.5
__________________
Xcart version 3.5.5.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:19 PM.

   

 
X-Cart forums © 2001-2020