X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Exclude Certain Categories From Category List (https://forum.x-cart.com/showthread.php?t=23766)

vipstore 08-11-2006 10:53 AM

thanks!

yages 06-15-2007 10:32 PM

Re: Exclude Certain Categories From Category List
 
Quote:

Originally Posted by balinor
Welcome to X-Cart! Please be sure to post your full version in your signature (i.e. 4.0.18). Each version is different, and this information is very important.

You can use the orderby function to solve your issue. Use an {if} statement like this to only show categories with an orderby under 500:

{if $categories[cat_num].order_by < 500}

This would go in customer/categories.tpl


does this work for 4.1.7

Widerimagellc 06-22-2007 07:15 AM

Re: Exclude Certain Categories From Category List
 
Quote:

Originally Posted by balinor
Welcome to X-Cart! Please be sure to post your full version in your signature (i.e. 4.0.18). Each version is different, and this information is very important.

You can use the orderby function to solve your issue. Use an {if} statement like this to only show categories with an orderby under 500:

{if $categories[cat_num].order_by < 500}

This would go in customer/categories.tpl




I have tried this if statement all throughout my categories.tpl and i just keep getting an error can some please help on where exactly to put this. Thanks so much

here is my categories.tpl

{* $Id: categories.tpl,v 1.26 2005/11/17 06:55:37 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="modules/Fancy_Categories/categories.tpl"}
{assign var="fc_cellpadding" value="0"}
{else}
{if $config.General.root_categories eq "Y"}
<div class="categories">
{foreach from=$categories item=c}
<a href="home.php?cat={$c.categoryid}">{$c.category}< /a>
{/foreach}
</div>
{else}
<div class="categories">
{foreach from=$subcategories item=c key=catid}
<a href="home.php?cat={$catid}">{$c.category}</a>
{/foreach}
</div>
{/if}
{/if}
{/capture}
{ include file="menu_cat.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}

Widerimagellc 06-25-2007 07:16 PM

Re: Exclude Certain Categories From Category List
 
Nevermind, I think,

here is my new categories.tpl code and this seems to be working......


{* $Id: categories.tpl,v 1.26 2005/11/17 06:55:37 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="modules/Fancy_Categories/categories.tpl"}
{assign var="fc_cellpadding" value="0"}
{else}
{if $config.General.root_categories eq "Y"}
<div class="categories">
{foreach from=$categories item=c}
{if $c.order_by < 500}
<a href="home.php?cat={$c.categoryid}">{$c.category}< /a>
{/if}{/foreach}
</div>
{else}
<div class="categories">
{foreach from=$subcategories item=c key=catid}
{if $c.order_by < 500}
<a href="home.php?cat={$catid}">{$c.category}</a>
{/if}{/foreach}
</div>
{/if}
{/if}
{/capture}
{ include file="menu_cat.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}

LittleLizard 09-25-2007 06:03 PM

Re: Exclude Certain Categories From Category List
 
Quote:

Originally Posted by Widerimagellc
Nevermind, I think,

here is my new categories.tpl code and this seems to be working......



Thank you so much for posting that - I needed to do the same thing and it worked great!


All times are GMT -8. The time now is 03:00 AM.

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