View Single Post
  #1  
Old 01-10-2017, 06:02 AM
 
xcartdev2 xcartdev2 is offline
 

Advanced Member
  
Join Date: Nov 2011
Posts: 43
 

Default Hide products from a category in search results only

I've got a category which is available and visible and has active products in it but I don't want those products to show in general searches. The categoryid is 273.

In includes/search.php I tried adding the line:
PHP Code:
if ($cat == ''
            
$inner_joins['categories']['on'] .= " AND $sql_tbl[categories].categoryid != 273"

Just below

PHP Code:
if ($current_area == 'C'
            
$inner_joins['categories']['on'] .= " AND $sql_tbl[categories].avail = 'Y'"


It does add this to the query so it reads "...INNER JOIN xcart_categories ON xcart_products_categories.categoryid = xcart_categories.categoryid AND xcart_categories.avail = 'Y' AND xcart_categories.catgeoryid != 273 ... " but seems to have no effect.

Any ideas how this can be done?
__________________
Verion 4.7.12
Reply With Quote