You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hi, I have lots of categories and each category has between like 5 and 20 items, and I want to put next to each Category the number of items that are in it. For example "Category (15)" Anyone know how I could go about doing this?
Thanks,
Bob
Offline
On the category pages.
Offline
In order to do this, open up the file ./cgi-bin/library/modules/ste_cat.pl for editing. Look in the routine 'ste_cat_desc' and find the lines:
if ($found_count ne "0") { &display_print('ste_cat_desc'); } ######### End of if statement.
Change to:
$category_itemsfound = "0"; if ($found_count ne "0") { &display_print('ste_cat_desc'); $sql_statement = " SELECT COUNT(*) FROM prodxcat WHERE prodxcat_sec=$dbins_fd_ref "; my @count = database_call('prodxcat','SELECT',$sql_statement); foreach $row(@count) {($category_itemsfound) = @$row;} if ($category_itemsfound <= "0") {$category_itemsfound = "0";} } ######### End of if statement.
Once you've made that hack, in admin choose to edit the site element named 'Category Heading Display'. Add this in there:
(CGIVAR)category_itemsfound(/CGIVAR)
Where you want the items found number.
Offline
webmaster,08/04/2004 10:18:42 AM wrote:
Code:
if ($found_count ne "0") { &display_print('ste_cat_desc'); } ######### End of if statement.
Hi Nick, I also want to apply this hack, but the code I need to change has some other lines meshed inbetween. I have this..
if ($found_count ne "0") { if ($category_active eq "N") { $category_descsale = ""; } ######### End of if statement. &display_print('ste_cat_desc'); } ######### End of if statement.
What do I replace?
Offline