![]() |
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) :D |
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}   (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. |
Well, here is the categories.tpl.....any specific suggestions?
Code:
{* $Id: categories.tpl,v 1.19 2003/11/11 14:02:32 svowl Exp $ *} 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 :roll: |
All times are GMT -8. The time now is 11:20 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.