Contributions

Features (Category Index)
Search: 

Enable & Disable Categories

This contribution will give you the ability to Enable and disable product categories. It will allow you to set the status of each category from the osCommerce admin section. It now has the green/red buttons same as products do for status, and can also be changed when editing that specific category.

Expand All / Collapse All

only fixed 1054 error 9 Jan 2011

If you get 1054 error, you need check your index.php file.

replace line 174 to line 189 using the following:

// We are asked to show only a specific category
// BOF Enable & Disable Categories
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id where c.categories_status = '1' and p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
// EOF Enable & Disable Categories
} else {

// We show them all
// BOF Enable & Disable Categories
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p)
left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id
left join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m
where c.categories_status = '1' and p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
// EOF Enable & Disable Categories
}
} else {
// show the products in a given categorie
if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
// BOF Enable & Disable Categories
$listing_sql = "select " . $select_column_list . " p.products_date_added, p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from (" . TABLE_PRODUCTS . " p )
left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id
left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id
left join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m
where c.categories_status = '1' and p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
// EOF Enable & Disable Categories

} else {
// We show them all
// BOF Enable & Disable Categories
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from ((" . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_CATEGORIES . " c on c.categories_id = p2c.categories_id where c.categories_status = '1' and p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
// EOF Enable & Disable Categories
}
}

Enable & Disable Categories 1.6.6 2 Dec 2008
Enable & Disable Categories 1.6.5 1 Oct 2008
Enable & Disable Categories 1.6.4 1 Oct 2008
Enable & Disable Categories 1.6.3 30 Sep 2008
Enable & Disable Categories 1.6.3 29 Sep 2008
Enable & Disable Categories 1.6.2 29 Sep 2008
This for who are using browse by categories contibution 17 Jan 2008
in Verwendung mit Link Manager II tritt Fehlermeldung "Fatal error: Cannot redeclare tep_set_categories_status() (previously declared in" auf 11 Sep 2007
Enable/Disable Categories for New Products Module 29 Aug 2007
Ebnable/Disabled Categories for featured products mod 29 Aug 2007
Enable Disable Categories - How To Modify Contributions, no support only listing off all modif for new contribution 8 Jun 2007
Specials modified 22 May 2006
Enable & Disable Categories 1.6.1.2 6 Dec 2005
Enable & Disable Categories 1.6.1.2 11 Oct 2005
Anleitung zu enable_disable_categories_1.6.1.1 28 Aug 2005
Enable & Disable Categories 1.6.1.1 2 Aug 2005
Enable & Disable Categories 1.6.1 11 Jul 2005
Fix to Best Sellers David Adams 1 Jun 2005
Enable & Disable Categories 1.6 Jinx720 10 Dec 2004
Enable & Disable Categories 1.5 Loic Richard 20 Sep 2004
Enable & Disable Categories 1.4 Olivier RONDEAU (DELABALLE) 5 Apr 2004
Kleine Änderungen bei setflag Andre Obholz 5 Feb 2004
Enable & Disable Categories 1.3.1 Celia Wessen 6 Jun 2003
Enable & Disable Categories 1.3.1 Celia Wessen 5 Jun 2003
Enable & Disable Categories 1.3 Mikel Williams 26 Feb 2003
Enable & Disable Categories Mikel Williams 24 Feb 2003
Enable & Disable Categories 1.1 Mikel Williams 16 Dec 2002
Enable & Disable Categories Mikel Williams 6 Sep 2002

Note: Contributions are used at own risk.