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
  #51  
Old 11-25-2005, 07:03 AM
 
whsu716 whsu716 is offline
 

Senior Member
  
Join Date: Jun 2005
Posts: 168
 

Default

Bumppp

anyone have a fix for the multiple category issue?

Thanks!
__________________
...
v 4.0.18; 4.1
Reply With Quote
  #52  
Old 11-26-2005, 09:07 PM
 
Abdul Abdul is offline
 

Member
  
Join Date: Jul 2004
Location: Miami
Posts: 17
 

Default

Cool mod, I just need it to show 2nd level category without having to click the main category.
so when you go to the home page it will show the main category and the subcategry below it automatically.
__________________
X-Cart 4.1.7 Gold
Reply With Quote
  #53  
Old 12-07-2005, 03:07 PM
 
Asiaplay Asiaplay is offline
 

X-Wizard
  
Join Date: Oct 2005
Posts: 1,242
 

Default Fashion Mosaic - Category & Subcategories

Hi All,

Thanks everyone for the great mod - just what I wanted!!!
To save anyone with the X-Cart "Fashion" Mosaic a little time I have list the code I used below - should work on all X-Cart fashion mosaic skins.

Cheers and hope is useful!!!

Code:
{capture name=menu} <TABLE border="0" width="100%" cellpadding="0" cellspacing="0" align="center"{if $main eq "catalog" and $current_category.category eq ""} height="214"{/if}> <TR> <TD valign="top"> {if $active_modules.Fancy_Categories ne ""} <TABLE border="0" width="150" cellpadding="0" cellspacing="0" align="center"{if $main eq "catalog" and $current_category.category eq ""} height="214"{/if}> <TR> <TD valign="top"> {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} </TD> </TR> </TABLE> {else} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid} [img]{$ImagesDir}/customer_images/vert_menuwelc_bullet.gif[/img]{$categories[cat_num].category} {else} [img]{$ImagesDir}/customer_images/vert_menu_bullet.gif[/img]{$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} {section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}[img]{$ImagesDir}/customer_images/vert_menu_bullet.gif[/img]{if $cat eq $allcategories[subcat].categoryid}{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}{/if} {/if} {/section} <HR size="0" noshade class="CateMenuHr"> {/if} {/section} {else} {section name=cat_num loop=$subcategories} <FONT class="CategoriesList">[img]{$ImagesDir}/customer_images/vert_menu_bullet.gif[/img]{$subcategories[cat_num].category}</FONT> {/section} {/if} {/if} </TD> </TR> <TR> <TD valign="bottom"> <TABLE border="0" width="100%" cellpadding="14" cellspacing="0" align="center"> <TR> <TD> {if $js_enabled} {$lng.txt_javascript_disabled} {else} {$lng.txt_javascript_enabled} {/if} </TD> </TR> <TR> </TABLE> </TD></TR> </TABLE> {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu style="Categories"}
__________________
X-Cart Gold version 4.1.9
(plus built in X-Cart bugs!)
Reply With Quote
  #54  
Old 12-09-2005, 07:39 AM
 
hyratech hyratech is offline
 

Senior Member
  
Join Date: Jul 2005
Posts: 172
 

Default

I did copy and pasted alphastara's code

it works fine..
except.. my categories are spaced a little too much making a very long list..
How can i modify that to make them closer to each other like the default setting?

Thanx for your help
__________________
hyratech
X-CART Gold 4.1.10
Hosted - Unix
Reply With Quote
  #55  
Old 12-19-2005, 08:53 AM
 
gfiebich gfiebich is offline
 

Senior Member
  
Join Date: Feb 2003
Location: St. Paul, MN
Posts: 108
 

Default

Here is a version of the above mod which displays categories and subcategories (2 levels) in an "always open" state. In addition, categories which contain subcategories are not linked. For example:

Category 1 (no link)
> Subcategory A (link)
> Subcategory B (link)
Category 2 (link)
Category 3 (no link)
> Subcategory C (link)
> Subcategory D (link)

This was done in x-cart gold 4.0.16

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} {* Determine if this category has a subcategory *} {section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid} {assign var="subs" value="yes"} {/if} {/section} {if $subs ne 'yes'} {* This category has no subcategories, so display the category name with a link *} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid} {$categories[cat_num].category} {else} {$categories[cat_num].category} {/if} {else} {* This category has subcategories, so display the category name without a link *} {if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid} <font class="VertMenuItemsBig">{$categories[cat_num].category}</font> {else} <font class="VertMenuItemsBig">{$categories[cat_num].category}</font> {/if} {/if} {* Display the subcategories *} {section name=subcat loop=$allcategories} {if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}&rsaquo;{if $cat eq $allcategories[subcat].categoryid}{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}{/if} {/if} {/section} {* reset the subcategory switch *} {assign var="subs" value="no"} {/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 }

Hope this is useful to someone.

-Glen
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
Reply With Quote
  #56  
Old 12-19-2005, 01:21 PM
 
electronics4less electronics4less is offline
 

Advanced Member
  
Join Date: Jul 2005
Posts: 38
 

Default

Any mods work for 4.0.9?

Functiong similarly to oscommerce. Category 1 selected, drops the subcategories. Another category 2 selected, Category 1 closes, and cat. 2 subcategories drop-down.

Thanks!
__________________
X-cart v4.0.8
Reply With Quote
  #57  
Old 12-25-2005, 06:34 PM
  davidsaldana's Avatar 
davidsaldana davidsaldana is offline
 

Senior Member
  
Join Date: Oct 2005
Posts: 187
 

Default

Great mod. One question.

Does anyone know how to modify the code to do the following:

Default:

Main Cat 1
Main Cat 2
Main Cat 3
Main Cat 4

Main Catagory 2 Selected:

Main Cat 1
Main Cat 2
>Sub Cat A
>Sub Cat B
>Sub Cat C
Main Cat 3
Main Cat 4

Sub Cat B Selected (Sub Cat A & Sub Cat C Disappear):

Main Cat 1
Main Cat 2
>Sub Cat B
>>Sub Sub Cat 1
>>Sub Sub Cat 2
>>Sub Sub Cat 3
Main Cat 3
Main Cat 4

Hope this makes sense. I basically want whatever catagory or subcatagory that is selected to be the main focus of the catagory list. This way the customer is more focused and there is no confusion about where he/she is.

Thanks
__________________
4.4
Code:
Hello World
Reply With Quote
  #58  
Old 01-11-2006, 01:12 AM
 
kostia kostia is offline
 

Member
  
Join Date: Nov 2005
Posts: 15
 

Default sort order

everything works well, except the sort order. I belive this requires something in categories.php. Anyone please suggest. I've changed sort order in admin panel but it doesn't affect to the menu. I'm newbie.

running 4.0.17
__________________
Xcart 4.0.17 GOLD
Reply With Quote
  #59  
Old 02-17-2006, 08:23 AM
  Alltribes's Avatar 
Alltribes Alltribes is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 192
 

Default

Has anyone gotten alphastara's code to go more than 3 levels deep? 3 levels works fine for my current setup, but I want to throw all my Jewelry into one main category to clean my menu up a bit. That will give me 4 levels.
__________________
Alltribes.com
Native American Jewelry
Pottery, Baskets, Kachinas & More

X-cart Gold Version 4.0.17 Live
PHP 5.2.6
MySQL 4.1.25
(mt)
Reply With Quote
  #60  
Old 02-24-2006, 03:37 AM
  proboscidian's Avatar 
proboscidian proboscidian is offline
 

Senior Member
  
Join Date: May 2005
Location: Clearwater, FL
Posts: 146
 

Default Re: sort order

[quote="kostia"]everything works well, except the sort order. I belive this requires something in categories.php. Anyone please suggest. I've changed sort order in admin panel but it doesn't affect to the menu.

Did anyone figure this out? The categories are sorting by default, but the subcategories are sorting alphabetically. I'd like them both to sort by default.
__________________
Industrial Webworks
Various xcart versions from 4.1.19 gold - 4.7 gold
http://www.industrialwebworks.net
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12:05 PM.

   

 
X-Cart forums © 2001-2020