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-02-2006 01:43 AM

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!

balinor 08-02-2006 03:20 AM

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

vipstore 08-02-2006 04:37 AM

Thanks!

I'll give that a shot...

carpeperdiem 08-02-2006 05:21 AM

Quote:

Originally Posted by balinor
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


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

balinor 08-02-2006 05:24 AM

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.

carpeperdiem 08-02-2006 02:46 PM

Quote:

Originally Posted by balinor
{if $categories[cat_num].order_by < 500}

Well, that didn't work for me... I'm using PhilJ's vflyout cateories, and I don't use categories.tpl -- the var is not working for me...

Any idea what var I should use?

The .tpl I need to change contains:
So does this mean incoming categories are renamed c.category ?

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

balinor 08-02-2006 05:17 PM

You'll need to ask Phil about how to work it with his module, sorry :(

vipstore 08-05-2006 04:50 AM

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


ummm...

Not to sound like a complete moron, but where would I place that?

Thanks!

vipstore 08-05-2006 08:33 PM

anyone?

thanks!

chamberinternet 08-11-2006 09:32 AM

Quote:

Originally Posted by vipstore
anyone?
thanks!


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.