Zen Cart Logo
Forums / General Questions / Inactive categories show up under sort option when browsing by brand...

Inactive categories show up under sort option when browsing by brand...

Views: 605

Results 1 to 2 of 2
9 May 2011, 3:24 PM
#1
audradh avatar

audradh

Zen Follower

Join Date:
Oct 2005
Location:
Eastern US
Posts:
429
Plugin Contributions:
0

Inactive categories show up under sort option when browsing by brand...

If a customer chooses a manufacturer to browse by...the option to sort by letter of the alphabet shows up...no problem. Also, the option shows to sort by category. If there is an active product, linked to an inactive category...then that category will show up. I had some inactive sale categories, "30% Off" etc that were inactive, the quick way to end a sale that might take forever to set up, or a way to setup a sale before it becomes active. I thought that this was a good solution, but this would kill that idea.

Is there a way that inactive categories can be excluded from this sort option, even if active products are within them?

thanks!
Audra

9 May 2011, 4:12 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Inactive categories show up under sort option when browsing by brand...

You could try customizing the SELECT in the:
/includes/index_filters/default_filter.php

and add the status check for the Categories:

      $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name
      from " . TABLE_PRODUCTS . " p, " .
      TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
      TABLE_CATEGORIES . " c, " .
      TABLE_CATEGORIES_DESCRIPTION . " cd
      where p.products_status = 1
        and p.products_id = p2c.products_id
        and p2c.categories_id = c.categories_id
        and p2c.categories_id = cd.categories_id
        and c.categories_status = 1
        and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
        and p.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'
      order by cd.categories_name";

and see if that results in the display that you are wanting ...