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

Is there a way to count # of subcategories of category id?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-18-2007, 06:35 PM
 
pdheady pdheady is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: West Palm Beach, FL
Posts: 36
 

Default Is there a way to count # of subcategories of category id?

I need to display how many subcategories belong to a category id. { $subcat.subcategory_count } should work and it's not.



{if $cat eq "655"}
<div class="bodytext1">There are <span style="color: #128B94; font-weight: bold">
{ $subcat.subcategory_count }
</span> styles to choose from.</div>
<br>
{/if}

__________________
Xcart 4.0.19
Reply With Quote
  #2  
Old 03-18-2007, 08:49 PM
 
pdheady pdheady is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: West Palm Beach, FL
Posts: 36
 

Default Re: Is there a way to count # of subcategories of category id?

For example I click on category A and I get 4 categories as below.

Category A
subcat 1
subcat 2
subcat 3
subcat 4

Now i just want the total subcat 1-4. So the subcat total = 4.

I need that value displayed on my page somehow and i've looked everywhere for it. The { $subcat.subcategory_count } will only total what's below the subcategories (ie. subcat1 = 0, subcat2 =0, etc). I want the total count of the subcat results.
__________________
Xcart 4.0.19
Reply With Quote
  #3  
Old 03-19-2007, 08:02 AM
 
pdheady pdheady is offline
 

Advanced Member
  
Join Date: Mar 2007
Location: West Palm Beach, FL
Posts: 36
 

Default Re: Is there a way to count # of subcategories of category id?

I found this code in /include/categories.php

I wonder if I can do something with this?

Quote:
#
# Count the subcategories
#
$category["subcategory_count"] = func_query_first_cell("SELECT subcategory_count FROM $sql_tbl[categories_subcount] WHERE categoryid='$cat'".($current_area == 'C'?" AND membership = '".addslashes($user_account["membership"])."'":""));

return $category;
}
__________________
Xcart 4.0.19
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12:31 PM.

   

 
X-Cart forums © 2001-2020