GetRow($query); $gparent_id = $parent_categories['gparent_id']; $parent_id = $parent_categories['parent_id']; } if ($parent_id == $gparent_id) { for ($i=0; $i < ($cp_size - 1); $i++) { $sCategoryNew .= '_' . $aCategoryPath[$i]; } } else { for ($i=0; $i < $cp_size; $i++) { $sCategoryNew .= '_' . $aCategoryPath[$i]; } } $sCategoryNew .= '_' . $current_category_id; if (substr($sCategoryNew, 0, 1) == '_') { $sCategoryNew = substr($sCategoryNew, 1); } } } else { $sCategoryNew = implode('_', $aCategoryPath); } return $sCategoryNew; } /** * Return the number of products in a category * * @param $category_id * @param $include_inactive * @return string */ function oos_total_products_in_category($category_id) { $products_count = 0; $dbconn =& oosDBGetConn(); $oostable =& oosDBGetTables(); $productstable = $oostable['products']; $products_to_categoriestable = $oostable['products_to_categories']; $products = $dbconn->Execute("SELECT COUNT(*) AS total FROM $productstable p, $products_to_categoriestable p2c WHERE p.products_id = p2c.products_id AND p.products_setting = '2' AND p2c.categories_id = '" . intval($category_id) . "'"); $products_count += $products->fields['total']; return $products_count; }