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

Can someone look at my categories.tpl code?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-10-2009, 05:10 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default Can someone look at my categories.tpl code?

Hi,

I'm on X-Cart 4.0.12.

I'm trying to get the categories.tpl menu to show all subcategories below the main category.

I've worked out that I am not using the official 4.0.12 categories.tpl because the code is different and I suspect it's because it was an upgrade that Qualiteam did from an earlier store. If it ain't broke, don't fix it!

Anyway, by reading through the various hacks I've come up with this in my categories.tpl code, which displays the subcategories for the main category you happen to be in. However, I actually want it to display all subcategories under the main categories all the time.

Quote:
{section name=cat_num loop=$categories}
<font class=CategoriesList><a href="home.php?cat={ $categories[cat_num].categoryid }" class=VertMenuItems>{$categories[cat_num].category}</a></font>

{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}
{section name=subcat_num loop=$subcategories}

<font class=CategoriesList><a href="home.php?cat={ $subcategories[subcat_num].categoryid }"> { $subcategories[subcat_num].category|escape }</a></font>

{/section}
{/if}

{/section}


I'm having a hell of a time getting this to happen as I've been trying in vain to use this type of code from other hacks for my version:

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

{/if}
{/section}

but all I seem to get is a not hyperlinked list of categories. Can anyone help?

Thanks

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #2  
Old 03-17-2009, 07:55 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Can someone look at my categories.tpl code?

In your first example you have
<a href="home.php?cat={ $categories[cat_num].categoryid }" class=VertMenuItems>{$categories[cat_num].category}</a>
which is the hyperlink. It is missing from your 2nd example.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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:04 AM.

   

 
X-Cart forums © 2001-2020