Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.89 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.   $category_depth = 'top';
  2.   if (isset($cPath) && tep_not_null($cPath)) {
  3.     $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
  4.     $cateqories_products = tep_db_fetch_array($categories_products_query);
  5.     if ($cateqories_products['total'] > 0) {
  6.       $category_depth = 'products'; // display products
  7.     } else {
  8.       $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
  9.       $category_parent = tep_db_fetch_array($category_parent_query);
  10.       if ($category_parent['total'] > 0) {
  11.         $category_depth = 'nested'; // navigate through the categories
  12.       } else {
  13.         $category_depth = 'products'; // category has no products, but display the 'no products' message
  14.       }
  15.     }
  16.   }