  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: category_tree.php 757 2006-08-23 12:22:54Z hpdl $ |
| |
| 3 | + | $Id: category_tree.php 758 2006-08-23 12:30:07Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
307 | 307 | | unset($totals); |
| |
308 | 308 | | } |
| |
309 | 309 | | |
  |
| 310 | + | function getNumberOfProducts($id) { |
| |
| 311 | + | foreach ($this->data as $parent => $categories) { |
| |
| 312 | + | foreach ($categories as $category_id => $info) { |
| |
| 313 | + | if ($id == $category_id) { |
| |
| 314 | + | return $info['count']; |
| |
| 315 | + | } |
| |
| 316 | + | } |
| |
| 317 | + | } |
| |
| 318 | + | |
| |
| 319 | + | return false; |
| |
| 320 | + | } |
| |
| 321 | + | |
  |
310 | 322 | | function setRootCategoryID($root_category_id) { |
| |
311 | 323 | | $this->root_category_id = $root_category_id; |
| |
312 | 324 | | } |