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

Catergories set-up to not display if no products in category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-07-2004, 11:39 PM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default Catergories set-up to not display if no products in category

I have a client that is running x-cart 3.5.3 and wants to have the categories set-up so they do not display on the customer front end if there are no avail products in that particular category.

I am still very much learning (and teaching myself) programming. I think I should be able to do this with a if/else statement but dont quite know what the rest of the code should be.

Anyone give me a hand with this? This would be a nice mod to come standard with x-cart (hint, hint)
__________________
Web site design - Custom Programming - Upgrades - Marketing
www.netvisionwebdesign.com

Follow on twitter: http://twitter.com/netvisionweb
Become a fan on Facebook: http://www.facebook.com/pages/NetVision-Web-Design/89463493419
Reply With Quote
  #2  
Old 03-08-2004, 05:21 PM
 
concepts concepts is offline
 

Senior Member
  
Join Date: Nov 2003
Posts: 104
 

Default

which cats? The side bar or the one in the middle which list sub cats also? Thats products.tpl

Anyway, find the code that shows the # of products inside the tpl

I am too lazy to look, maybe someone can post the code.

for example sake, lets just call it $productcount or whatever

{if $productcount eq 0}
&nbsp (if you run a table or whatever) blank
{elseif $productcount ne 0}
category name here (original section which shows the categories name)
{/if}

I am using elseif because I think there is already an else call somewhere in there already.
Reply With Quote
  #3  
Old 03-08-2004, 11:48 PM
  enge919's Avatar 
enge919 enge919 is offline
 

Senior Member
  
Join Date: May 2003
Posts: 141
 

Default

Well, here is the categories.tpl.....any specific suggestions?

Code:
{* $Id: categories.tpl,v 1.19 2003/11/11 14:02:32 svowl Exp $ *} {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} <font class=CategoriesList>{ $categories[cat_num].category_name|escape }</font> {/section} {else} {section name=cat_num loop=$subcategories} <font class=CategoriesList>{ $subcategories[cat_num].category_name|escape }</font> {/section} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }

BTW
I am just looking for the side bar categories to be disabled if no products under that category/sub-category.

Come to think of it, I guess if there are no sub-categories being used just the main category in the side bar should be disabled automatically, but, if he is using sub-categories, then just that sub-category should be automatically disabled. This my be tougher that I thought
__________________
Web site design - Custom Programming - Upgrades - Marketing
www.netvisionwebdesign.com

Follow on twitter: http://twitter.com/netvisionweb
Become a fan on Facebook: http://www.facebook.com/pages/NetVision-Web-Design/89463493419
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 07:52 PM.

   

 
X-Cart forums © 2001-2020