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

category list 4.1.9

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-11-2008, 05:47 PM
 
sunny sunny is offline
 

Advanced Member
  
Join Date: Mar 2005
Location: Lakewood, Colorado
Posts: 38
 

Default category list 4.1.9

Hello,

I'm currently upgrading a cart from 4.0.19 to 4.1.9. The older version has a flyout menu for the categories. This is an accumulation of a couple of different codes. It uses a variation of meniu.tpl from http://forum.x-cart.com/showthread.php?t=24388&highlight=category+css+list . The code is

Code:
{* $Id: categories.tpl,v 1.23 2007/05/12 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"} <div id="sidemenu"> <ul> {*** level 1***} {section name=l1_cat_num loop=$allcategories} {if $allcategories[l1_cat_num].parentid eq 0} <li><a href="home.php?cat={$allcategories[l1_cat_num].categoryid}" title="{$allcategories[l1_cat_num].category}">{$allcategories[l1_cat_num].category} {*** count products***} {*{if $allcategories[l1_cat_num].product_count gt 0} ({$allcategories[l1_cat_num].product_count}) {/if}*} {if $allcategories[l1_cat_num].subcategory_count gt 0}{* ╩ *} {/if} <!--[if IE 7]><!--></a><!--<![endif]--> {if $allcategories[l1_cat_num].subcategory_count gt 0} {*** check if root cat has child cats ***} {*** end level 1***} {*** level 2***} <ul> {section name=l2_cat_num loop=$allcategories} {if $allcategories[l2_cat_num].parentid eq $allcategories[l1_cat_num].categoryid} <li><a href="home.php?cat={$allcategories[l2_cat_num].categoryid}" title="{$allcategories[l2_cat_num].category}">{$allcategories[l2_cat_num].category} {*** count products***} {*{if $allcategories[l2_cat_num].product_count gt 0} ({$allcategories[l2_cat_num].product_count}) {/if}*} {if $allcategories[l2_cat_num].subcategory_count gt 0}{* ╩ *}{/if}<!--[if IE 7]><!--></a><!--<![endif]--> {if $allcategories[l2_cat_num].subcategory_count gt 0} {*** check if parent has child cats***} {*** end level 2***} {*** level 3***} <ul> {section name=l3_cat_num loop=$allcategories} {if $allcategories[l3_cat_num].parentid eq $allcategories[l2_cat_num].categoryid} <li><a href="home.php?cat={$allcategories[l3_cat_num].categoryid}" title="{$allcategories[l3_cat_num].category}">{$allcategories[l3_cat_num].category} {*** count products***} {*{if $allcategories[l3_cat_num].product_count gt 0} ({$allcategories[l3_cat_num].product_count}) {/if}*} {if $allcategories[l3_cat_num].subcategory_count gt 0}{* ╩ *}{/if}<!--[if IE 7]><!--></a><!--<![endif]--> {if $allcategories[l3_cat_num].subcategory_count gt 0} {*** check if parent has child cats***} {*** end level 3***} {*** level 4***} <ul> {section name=l4_cat_num loop=$allcategories} {if $allcategories[l4_cat_num].parentid eq $allcategories[l3_cat_num].categoryid} <li><a href="home.php?cat={$allcategories[l4_cat_num].categoryid}" title="{$allcategories[l4_cat_num].category}">{$allcategories[l4_cat_num].category} {*** count products***} {*{if $allcategories[l4_cat_num].product_count gt 0} ({$allcategories[l4_cat_num].product_count}) {/if}*}<!--[if IE 7]><!--></a><!--<![endif]--> {/if}{/section} </li> </ul> {*** end level 4***} <!--[if lte IE 6]></a><![endif]--> {/if}{/if}{/section}</li> </ul> <!--[if lte IE 6]></a><![endif]--> {/if}{/if}{/section}</li> </ul> <!--[if lte IE 6]></a><![endif]--> {/if}{/if}{/section}</li> </ul> </div> {/if} {/if} {/capture} { include file="menu_rev.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories_rev menu_content=$smarty.capture.menu }

There is enough difference in how the code calls the categories and subcategories between the two versions that this is no longer working. I have figured out how to access the main category level but cannot access the subcategories.

Any thoughts on how to change accessing the subcategories?

Any help is greatly appreciated.

Carol Davenport
__________________
4.1.9
Reply With Quote
  #2  
Old 03-13-2008, 01:06 AM
  Holub's Avatar 
Holub Holub is offline
 

X-Adept
  
Join Date: Jan 2008
Posts: 432
 

Default Re: category list 4.1.9

Please see include/categories.php

There is some code

Code:
if (($current_area == "C" && defined("GET_ALL_CATEGORIES")) || defined('MANAGE_CATEGORIES')) { $_categories = func_get_categories_list($cat); } elseif($current_area == "C") { $_categories = func_get_categories_list($cat, true, "current"); } else { $_categories = func_get_categories_list($cat, true, "all"); }

by default the variable "GET_ALL_CATEGORIES" is not defined.

I've added

Code:
define("GET_ALL_CATEGORIES","1");

and now I have list of all categories in
PHP - $all_categories
Smarty - $allcategories
__________________
Regards,
Anthony Holub

X-Cart Skins Store
- twenty two different skins available;
- both 4.1.x and 4.2.x versions compatible;
- refresh you store now!

Smart menu X-Cart add-on
Featured Products Slide Show X-Cart add-on
"What's New?" FREE X-Cart add-on
Reply With Quote
  #3  
Old 03-13-2008, 06:49 AM
 
sunny sunny is offline
 

Advanced Member
  
Join Date: Mar 2005
Location: Lakewood, Colorado
Posts: 38
 

Smile Re: category list 4.1.9

Thank you, thank you, thank you!! That did the trick.

Carol Davenport
__________________
4.1.9
Reply With Quote
  #4  
Old 03-13-2008, 06:53 AM
  Holub's Avatar 
Holub Holub is offline
 

X-Adept
  
Join Date: Jan 2008
Posts: 432
 

Default Re: category list 4.1.9

I'am very glad that I've help you!
__________________
Regards,
Anthony Holub

X-Cart Skins Store
- twenty two different skins available;
- both 4.1.x and 4.2.x versions compatible;
- refresh you store now!

Smart menu X-Cart add-on
Featured Products Slide Show X-Cart add-on
"What's New?" FREE X-Cart add-on
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:57 AM.

   

 
X-Cart forums © 2001-2020