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

Exclude Certain Categories From Category List

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-02-2006, 01:43 AM
  vipstore's Avatar 
vipstore vipstore is offline
 

Advanced Member
  
Join Date: Apr 2006
Posts: 33
 

Default 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!
__________________
version 4.0.18
Reply With Quote
  #2  
Old 08-02-2006, 03:20 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Welcome to X-Cart! Please be sure to post your full version in your signature (i.e. 4.0.1. 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
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 08-02-2006, 04:37 AM
  vipstore's Avatar 
vipstore vipstore is offline
 

Advanced Member
  
Join Date: Apr 2006
Posts: 33
 

Default

Thanks!

I'll give that a shot...
__________________
version 4.0.18
Reply With Quote
  #4  
Old 08-02-2006, 05:21 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default

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
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #5  
Old 08-02-2006, 05:24 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 08-02-2006, 02:46 PM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default

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
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #7  
Old 08-02-2006, 05:17 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

You'll need to ask Phil about how to work it with his module, sorry
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #8  
Old 08-05-2006, 04:50 AM
  vipstore's Avatar 
vipstore vipstore is offline
 

Advanced Member
  
Join Date: Apr 2006
Posts: 33
 

Default

Quote:
Originally Posted by balinor
Welcome to X-Cart! Please be sure to post your full version in your signature (i.e. 4.0.1. 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!
__________________
version 4.0.18
Reply With Quote
  #9  
Old 08-05-2006, 08:33 PM
  vipstore's Avatar 
vipstore vipstore is offline
 

Advanced Member
  
Join Date: Apr 2006
Posts: 33
 

Default

anyone?

thanks!
__________________
version 4.0.18
Reply With Quote
  #10  
Old 08-11-2006, 09:32 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default

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
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
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 11:41 PM.

   

 
X-Cart forums © 2001-2020