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

Categories Menu - Showing Subcategories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #41  
Old 10-12-2005, 05:40 PM
 
alphastara alphastara is offline
 

Advanced Member
  
Join Date: Jul 2005
Posts: 39
 

Default 3 Levels!

Okay here we go people, I've managed to get it to 3 levels of categories, I need more time to get it down more because my store has 5 levels in some areas I'll keep you posted.
Here is the code for /customer/categories.tpl

Code:
{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} {assign var=topmostcat value=$current_category.categoryid_path|regex_replace:"/\/.*/":""} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid || $topmostcat eq $categories[cat_num].categoryid} {$categories[cat_num].category} {else} {$categories[cat_num].category}<HR size="1" noshade class="CateMenuHr"> {/if} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid || $topmostcat eq $categories[cat_num].categoryid} {section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid} {if $cat eq $allcategories[subcat].categoryid || $current_category.parentid eq $allcategories[subcat].categoryid}{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid || $current_category.parentid eq $allcategories[subcat].categoryid}{/if} {if $cat eq $allcategories[subcat].categoryid || $allcategories[$cat].parentid eq $allcategories[subcat].categoryid || $current_category.parentid eq $allcategories[subcat].categoryid} {section name=subcat2 loop=$allcategories} {if $allcategories[subcat2].parentid eq $allcategories[subcat].categoryid || $current_category.parentid eq $subcategories[subcat2].categoryid} {if $cat eq $allcategories[subcat2].categoryid}{/if}{$allcategories[subcat2].category}{if $cat eq $allcategories[subcat2].categoryid}{/if} {/if} {/section} {/if} {/if} {/section} <HR size="1" noshade class="CateMenuHr"> {/if} {/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}
__________________
Alphastara | New Age Products
www.alphastara.com.au
V: 4.1.6 + AOM
Reply With Quote
  #42  
Old 10-13-2005, 09:22 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default

Wow. Copy, paste, move on! This is exactly what I needed! Thanks. Now I've gotta figure out how to get DSEFU mod to work with it.

Great work, thank you for sharing it.
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #43  
Old 10-13-2005, 02:57 PM
 
alphastara alphastara is offline
 

Advanced Member
  
Join Date: Jul 2005
Posts: 39
 

Default

Which is the DSEFU mod? Sorry
__________________
Alphastara | New Age Products
www.alphastara.com.au
V: 4.1.6 + AOM
Reply With Quote
  #44  
Old 10-13-2005, 03:21 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Just get John to install the DSEFU mod for you. And alphastara, here's the link for the mod...essential in my book:

http://www.safetynetweb.com/Dynamic-Search-Engine-Friendly-URLs-pr-1.html
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #45  
Old 10-13-2005, 03:53 PM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default

Thanks Balinor. I already got John to install it once, and have gotten great support for his mod since. Just wish I didn't have to bother him every time I make a change to categories.tpl! And, yes, it is essential in my book too.
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #46  
Old 10-20-2005, 07:58 PM
 
alphastara alphastara is offline
 

Advanced Member
  
Join Date: Jul 2005
Posts: 39
 

Default

Anyone help me with getting my last lot of code to one more level depth? I have been trying to use regex_replace etc to get root cat level of subcats which works fine but i need to find 2nd top cat for the subcats...if that makes sense

Anyway, if i go 4 sub cats deep it still opens up the root cat menu so that isn't too bad...
__________________
Alphastara | New Age Products
www.alphastara.com.au
V: 4.1.6 + AOM
Reply With Quote
  #47  
Old 10-29-2005, 03:28 AM
 
whsu716 whsu716 is offline
 

Senior Member
  
Join Date: Jun 2005
Posts: 168
 

Default

THANK YOU!!!!
__________________
...
v 4.0.18; 4.1
Reply With Quote
  #48  
Old 10-30-2005, 09:13 PM
 
Amy Amy is offline
 

Senior Member
  
Join Date: Feb 2004
Posts: 147
 

Default

thanks so much for the mod!
Reply With Quote
  #49  
Old 11-01-2005, 07:09 AM
  RichieRich's Avatar 
RichieRich RichieRich is offline
 

X-Adept
  
Join Date: Sep 2004
Location: London, England
Posts: 750
 

Default

please post when you have more levels of sub-category depth
__________________
Richard


Ultimate 5.4 testing
Reply With Quote
  #50  
Old 11-03-2005, 12:53 PM
 
Sonia Sonia is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 72
 

Default

Hey, I just implemented Alphastara's code, near the bottom of page 3, and it works like a charm (all praise Alphastar! I want, though, to have the sub menu open at all times. Does anyone know how to change the code to make that happen?

I would appreciate someone letting me know how. Perhaps others would like the same thing....(shrug)
__________________
Sonia

www.vidaville.com
Xcart Gold 4.0.16
platform - Windows
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 05:37 AM.

   

 
X-Cart forums © 2001-2020