Quote Originally Posted by DivaVocals View Post
Figured it out.. I was looking at the wrong query...

around line 92 find this:
Code:
// add product links
      if (SHOW_PRODUCT_LINKS_ON_SITE_MAP == 'Yes') {
      $product_sql = "select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .
      TABLE_PRODUCTS_TO_CATEGORIES . " p2c 
      where p.products_id = pd.products_id 
      and p.products_id = p2c.products_id 
      and p2c.categories_id = '" . $category_id . "' 
      order by p.products_sort_order, pd.products_name";
Make the changes highlighted below.. The changes below do the following:

  1. Prevent the sitemap from displaying inactive products
  2. Changes the sorting of the products so that they are sorted by name (which IMO is more logical than the current order by)

If you only want to stop the display of inactive products and retain the current sort order then do not make the change highlighted in blue
Code:
// add product links - CMJ 09/20/2009 modified to change sort order and exclude inactive products 
      if (SHOW_PRODUCT_LINKS_ON_SITE_MAP == 'Yes') {
      $product_sql = "select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .
      TABLE_PRODUCTS_TO_CATEGORIES . " p2c 
      where p.products_id = pd.products_id 
      and p.products_id = p2c.products_id 
      and p2c.categories_id = '" . $category_id . "' 
      and p.products_status != '0'
      order by pd.products_name, p.products_sort_order ";
Hope this helps someone else..
Fine !
I added the language used in the query :

$product_sql = "select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " .
TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p.products_id = p2c.products_id
and p2c.categories_id = '" . $category_id . "'
and p.products_status != '0'
order by pd.products_name, p.products_sort_order ";

So you obtain only 1 line !
Bertrand