X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Categories Menu - Showing Subcategories (https://forum.x-cart.com/showthread.php?t=3242)

whsu716 08-08-2005 10:42 PM

any luck anyone?

whsu716 08-08-2005 11:02 PM

anyone with the subcat fix?

sorry for the repost!

killervette 08-23-2005 08:54 AM

this work with 4.0.14???

STORed 09-15-2005 09:03 AM

Yes,

The code in this thread is about 9 months old. I took a look at the 4.0.14 and it looks quite different. Is ther anything similar to this fo the newer version?

F5Performance 09-19-2005 07:30 PM

Yeah, becasue I just tried this and its wayy FUBAR. :lol:

fuzzy 09-30-2005 05:53 AM

This works in 4.0.12--4.0.16
/xcart/skin1/categories.tpl
Code:

{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}
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}
{$categories[cat_num].category}

{else}
{$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}{$allcategories[subcat].category}

{/if}
{/section}
<HR size="1" noshade class="CateMenuHr">
{/if}
{/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 }


Now could someone maybe tweak this so the current "sub-cat" will be bold? Please! Pretty even!! :wink:
I've gotten close....but must be missing something. ](*,)

alphastara 10-03-2005 03:14 PM

Thats pretty easy, with your code change the following line:
Code:

{if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}{$allcategories[subcat].category}
to

Thank me later :wink: :D

fuzzy 10-03-2005 04:18 PM

Quote:

Originally Posted by alphastara
Thats pretty easy, with your code change the following line:
Code:

{if $allcategories[subcat].parentid eq $categories[cat_num].categoryid}{$allcategories[subcat].category}
to

Thank me later :wink: :D


Well Bless your pea picken heart! That works Great! :D
Thanks to alphastara for the final (DUH) :wink: tweak, here's the copy & paste code for
skin1/customer/categories.tpl
Code:

{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}
{if $cat eq $categories[cat_num].categoryid || $current_category.parentid eq $categories[cat_num].categoryid}
{$categories[cat_num].category}

{else}
{$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}{if $cat eq $allcategories[subcat].categoryid}{/if}{$allcategories[subcat].category}{if $cat eq $allcategories[subcat].categoryid}{/if}

{/if}
{/section}
<HR size="1" noshade class="CateMenuHr">
{/if}
{/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 }

I also added the CSS call to match the rest.

alphastara 10-03-2005 05:06 PM

Thats great :D

I am now working on allowing more levels of subcategories... :?

dgreen 10-11-2005 06:55 AM

more levels of subcategories
 
Did you come up with the code to allow more levels of subcategories?
I could use something like that but I have no time to work on it. (I am under a major deadline and I am due to have a baby any day)


All times are GMT -8. The time now is 05:54 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.