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

subcategory list on home

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 05-16-2004, 11:29 PM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default

that template coding didn;t want to work, i managed to get it working using the following coding instead :
Code:
{if $categories_data[subcat_num].root_category_name == $categories[cat_num].category && $categories_data[subcat_num].category_name != $categories[cat_num].category_name && $categories_data[subcat_num].sub_category_name == $categories_data[subcat_num].root_category_name}
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
  #12  
Old 06-08-2004, 03:23 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Thanks for the useful mod
Reply With Quote
  #13  
Old 07-10-2004, 09:37 PM
 
andreas04031 andreas04031 is offline
 

Advanced Member
  
Join Date: Jun 2004
Location: Dallas, TX
Posts: 64
 

Default wasn't working for me

Parse error: parse error, unexpected $ in /hsphere/local/home/reginaha/shrinkbagsandmore.com/shrink-bags/templates_c/customer^categories.tpl on line 79


any suggestions?
__________________
X-Cart version 3.5.9 (online)
X-Cart Version 4.0.19 (online)
X-Cart Version 4.1.3 (in dev)
PHP 4.4.4
MySQL 4.1.21
Reply With Quote
  #14  
Old 07-10-2004, 09:43 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Look at your line # 79 in categories.tpl and see if you are missing a bracket or closing IF tag.
Reply With Quote
  #15  
Old 07-10-2004, 11:16 PM
 
andreas04031 andreas04031 is offline
 

Advanced Member
  
Join Date: Jun 2004
Location: Dallas, TX
Posts: 64
 

Default

my categories.tpl has just 29 lines, do you mean categories.php?

can you see something in the code below?

this is line 75 - 90 from my categories.php

Code:
$all_categories = $categories_data; # # # if (!empty($active_modules["Fancy_Categories"])) @include $xcart_dir."/modules/Fancy_Categories/fancy_categories.php"; # # Put all root categories to $categories array # Put all subcategories of current_category to $categories array # if (!empty($current_category)) $cur_dir_len = strlen($current_category["category"]); foreach($all_categories as $all_category) {

thanks for your time, andreas
__________________
X-Cart version 3.5.9 (online)
X-Cart Version 4.0.19 (online)
X-Cart Version 4.1.3 (in dev)
PHP 4.4.4
MySQL 4.1.21
Reply With Quote
  #16  
Old 07-14-2004, 03:39 PM
 
viridiancity viridiancity is offline
 

Newbie
  
Join Date: Mar 2004
Posts: 7
 

Default

Can anyone help adapt this mod for 4.0.0? The variables in the categories.php file are different, and I'm no longer certain what to change ...
Reply With Quote
  #17  
Old 07-14-2004, 08:32 PM
 
Wizard Wizard is offline
 

Advanced Member
  
Join Date: Jun 2004
Posts: 40
 

Default

Quote:
Originally Posted by viridiancity
Can anyone help adapt this mod for 4.0.0? The variables in the categories.php file are different, and I'm no longer certain what to change ...

Looking in the settings for 4.0 there is a checkbox in the general settings that will display your subcategories where your categories go....
__________________
Mike

X-Cart 4.0.9 Gold (In Development)
No Live Site

Server version: Apache/1.3.28 (Unix) FrontPage/5.0.2.2510 mod_ssl/2.8.15 OpenSSL/0.9.7a PHP-CGI/0.1b
Reply With Quote
  #18  
Old 09-28-2004, 08:44 PM
 
jimmy_ jimmy_ is offline
 

Advanced Member
  
Join Date: Sep 2004
Posts: 37
 

Default

Where is this option in v4.0.4 I am sure its just me but I cannot seem to find this
Reply With Quote
  #19  
Old 11-02-2004, 11:17 AM
 
Professor_Kan Professor_Kan is offline
 

Member
  
Join Date: Oct 2004
Posts: 21
 

Default

Many thanks for this code. It worked out great !!!

Here is the code for those of you whom wish to retain the default style sheet and main category link;

Code:
<font class=CategoriesList> {section name=cat_num loop=$categories} <a href="home.php?cat={$categories[cat_num].categoryid}" class=VertMenuItems>{$categories[cat_num].category_name} <span class="sub" id="{$categories[cat_num].categoryid}"> {section name=subcat_num loop=$categories_data} {if $categories_data[subcat_num].root_category_name == $categories[cat_num].category && $categories_data[subcat_num].category_name != $categories[cat_num].category_name} <a href="home.php?cat={$categories_data[subcat_num].categoryid}"> -{$categories_data[subcat_num].category_name} {/if} {/section} </span> {/section} </A></font>
__________________
168
Reply With Quote
  #20  
Old 11-18-2004, 10:16 AM
  joshf's Avatar 
joshf joshf is offline
 

Advanced Member
  
Join Date: Jul 2003
Posts: 97
 

Default Always display subcategories in 4.0.x

Here's what worked for me in 4.0.x:

In skin1/customer/categories.tpl:

1. Find the following line:
Code:
<FONT class="CategoriesList">{$categories[cat_num].category}</FONT>
2. Insert the following code AFTER the line you just found:
Code:
{section name=sub_num loop=$allcategories} {if $allcategories[sub_num].parentid == $categories[cat_num].categoryid} <FONT class="CategoriesList">- {$allcategories[sub_num].category}</font> {/if} {/section}
3. Save and refresh.


One,
jf
__________________
joshf | X-Cart Portfolio
Currently: http://nightowlpapergoods.com | http://pinkolive.com
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 04:10 AM.

   

 
X-Cart forums © 2001-2020