Exclude Certain Categories From Category List
I'm wanting to have certain categories not listed in the category list, but still be available (via links elsewhere)...
Any thoughts? Thanks! |
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 |
Thanks!
I'll give that a shot... |
Quote:
Padraic, Could this be one way to generate a static "top-ten/fake bestsellers" list? 1. make a category, let's say POS 990 2. Propagate the category with items that will be in my bestseller list 3. hide the category from the category list using an {if} statement 4. in menu_bestsellers.tpl use the category to generate the list of its products Let me go to work on this... Thanks for the tip... Jeremy |
Yep..exactly. We use it frequently to create 'hidden' categories that we want to target as landing pages for AdWords campaigns or promotions and as Special Offers categories (using the disasterous Special Offers Add-on). Just note that the products will still show up in a search even though the category doesn't show up in the menu.
There is also a 'Hidden Categories' custom mod in the Custom Mod forums which uses a different approach to the problem. |
Quote:
Any idea what var I should use? The .tpl I need to change contains: Code:
{foreach from=$categories item=c}[*]{$c.category}{if $c.subcats}{if $showarrows eq "y"}<font class="arrow">»</font>{/if}{/if} I tried {if $c.category[order_by] lt 900 }{/if} -- no good I tired {if $c.category.order_by lt 900 }{/if} -- no good I tired {if $c.categories[order_by] lt 900 }{/if} -- no good I tired {if $c.categories.order_by lt 900 }{/if} -- no good Am I putting the {/if} in th right place? if I were flowcharting this, I'd say, "if the category POS is lt 900, then continue on, otherwise, you're stuck -- don't pass go. I've been staring at the screen too long, I can't think straight... This smarty thing is 3 steps forward 5 steps back. Ugh. :-( Anyone? My goal is to trap any category with a POS greater than 900 to not show up in the categories list. Your assistance is appreciated. Thanks, Jeremy |
You'll need to ask Phil about how to work it with his module, sorry :(
|
Quote:
ummm... Not to sound like a complete moron, but where would I place that? Thanks! |
anyone?
thanks! |
Quote:
Hello ... This is what my file looks like (I'm using v4.1.2) {* $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"} {foreach from=$categories item=c} {* MOD http://forum.x-cart.com/viewtopic.php?t=31058 *} {if $c.order_by < 500} <font class="CategoriesList">{$c.category}</font> {/if} {/foreach} {else} {foreach from=$subcategories item=c key=catid} {* MOD - http://forum.x-cart.com/viewtopic.php?t=31058 *} {if $c.order_by < 500} <font class="CategoriesList">{$c.category}</font> {/if} {/foreach} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding} Hope this helps. Regards Shafiq :sK |
All times are GMT -8. The time now is 03:06 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.