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

ALWAYS display first level subcats beneath root cats

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 07-09-2005, 01:18 PM
 
shirley2005 shirley2005 is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 33
 

Default

Many thanks ExoZed and bluski!
I love this mod!
__________________
x-cart 4.0.14 Pro
Reply With Quote
  #12  
Old 07-09-2005, 08:33 PM
 
shirley2005 shirley2005 is offline
 

Advanced Member
  
Join Date: Jun 2005
Posts: 33
 

Default

I want the current subcategory in menu to have different style, for example "Bold".
How to do this?

Thanks.
__________________
x-cart 4.0.14 Pro
Reply With Quote
  #13  
Old 09-16-2005, 10:50 AM
 
rightminddesigns rightminddesigns is offline
 

Advanced Member
  
Join Date: Sep 2005
Posts: 33
 

Default

Quote:
Originally Posted by shirley2005
I want the current subcategory in menu to have different style, for example "Bold".
How to do this?

Thanks.

Not sure if you still need help with this, but if others are searching I would guess it would be done in this section:

Code:
{section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid} {$allcategories[subcat].category} {/if} {/section}

Create a class in the stylesheet to control the look you want and assign the class to the anchor tag, like this (using whatever you have named the class in the stylesheet in place of the "SubCatStyle" I used here):
Code:
{section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid} {$allcategories[subcat].category} {/if} {/section}

Hope that helps!
__________________
X-Cart Gold 4.0.15 on Linux machine
Modules:
Features Comparison
Product Configurator
Fancy Categories (turned off)
Reply With Quote
  #14  
Old 09-18-2005, 10:01 AM
 
salsabeel salsabeel is offline
 

Senior Member
  
Join Date: Jan 2004
Posts: 132
 

Default

How can you display sub-subcategories with this mod?

i.e.

-Cat 1
--Sub Cat 1
---Sub-Sub Cat 1
---Sub-Sub Cat 2
---Sub-Sub Cat 3
--Sub Cat 2
--Sub Cat 3
-Cat 2
-Cat 3
__________________
X-Cart Platinum 4.6.5
Reply With Quote
  #15  
Old 09-19-2005, 08:53 AM
  STORed's Avatar 
STORed STORed is offline
 

Advanced Member
  
Join Date: Sep 2005
Posts: 69
 

Default

I'm not sure what does the last part of the code do?

Quote:
{else}
{section name=cat_num loop=$subcategories}
{$subcategories[cat_num].category}

{/section}
{/if}
__________________
Thanks.

X-Cart Gold 4.0.14 on Linux
Reply With Quote
  #16  
Old 09-19-2005, 09:17 AM
  STORed's Avatar 
STORed STORed is offline
 

Advanced Member
  
Join Date: Sep 2005
Posts: 69
 

Default

Nevermind just figured that one out...
__________________
Thanks.

X-Cart Gold 4.0.14 on Linux
Reply With Quote
  #17  
Old 09-20-2005, 12:16 AM
 
ExoZed ExoZed is offline
 

Member
  
Join Date: Apr 2005
Posts: 28
 

Default Sub-sub categories

To display further sub-subcategories you could just add a section loop within the existing 'subcat' section loop. This seems a bit convoluted but haven't had time to figure it out properly - there would be a much nicer way to do it in include/categories.php if you were to sort an array properly. But for anyone not bothered, smarty seems to be fast enough to handle doing all these loops...

Code:
{* $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 name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid} {$allcategories[subcat].category} {section name=subsubcat loop=$allcategories} {if $allcategories[subsubcat].parentid eq $allcategories[subcat].categoryid} >{$allcategories[subsubcat].category} {/if} {/section} {/if} {/section} {/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 }

It's the section loop called 'subsubcat' that adds these categories, with a > infront of the name. This is the only thing I added to do this.
__________________
--------------------------------------------


4.0.14-gold_upgrade
Reply With Quote
  #18  
Old 09-20-2005, 12:18 PM
  shipmerchant's Avatar 
shipmerchant shipmerchant is offline
 

eXpert
  
Join Date: Mar 2005
Posts: 361
 

Default

Hi All,

Is there a working url to actually see the demo of this mod?
I would like to see it if no one minds that is.

Thanks in advance!
__________________
Mil Mascaras
Live Xcart Site #1-V- 4.1.8
Live Xcart site # 2-V 4.4.3
CDSEO Mod - Firetank MM30 - 7DANA- The bestTemplates!
Linux - EWD Host Servers awesome service!
AlteredCart One Page Checkout
Reply With Quote
  #19  
Old 05-07-2006, 03:48 PM
 
force8 force8 is offline
 

Newbie
  
Join Date: Jan 2005
Posts: 2
 

Default

This is a really great mod, thanks for posting it!

I just have a question - How would this code work with the new 4.1 version of x-cart?

for example - what would be the 4.1 equivilent be of:

Code:
{section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid} {$allcategories[subcat].category} {/if} {/section}

TIA
-NIC
__________________
hello there
Reply With Quote
  #20  
Old 05-08-2006, 06:09 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default

Does this mod work in version 4.1.0 ?

Regards

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
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 07:41 PM.

   

 
X-Cart forums © 2001-2020