Search is not filtering out results
Hello Webassist! I'm hoping that you can help me solve a mystery.
We have two ecommerce sites which share one database between them. We differentiate products for our site using a ProductExclusiveFire column. "0" (our site) or "2" (both sites). We filtered the results in our recordset using WHERE (ProductExclusiveFire = 0 OR ProductExclusiveFire = 2)
"SELECT DISTINCT products.* FROM products LEFT OUTER JOIN productcategoriesjoin ON JoinProduct = ProductID WHERE (ProductDeactivate = 0) AND (ProductExclusiveFire = 0 OR ProductExclusiveFire = 2)"
We also filtered our search results to say "AND NOT ProductExclusiveFire = 1"
$WADbSearch1->addComparison("ProductExclusiveFire","1","AND NOT","=",1);
$WADbSearch1->addComparison("ProductExclusiveBM","1","AND NOT","=",1);
$WADbSearch1->addComparison("ProductDeactivate","1","AND NOT","=",1);
$WADbSearch1->addComparisonFromList("JoinCategory","S_ProductCategoryID","AND","=",1);
$WADbSearch1->addComparisonFromEdit("ProductName","S_ProductName","AND","Includes",0);
$WADbSearch1->addComparisonFromEdit("ProductSKU","S_ProductName","OR","Includes",0);
$WADbSearch1->addComparisonFromEdit("ProductManufacturer","S_ProductName","OR","Includes",0);
$WADbSearch1->addComparisonFromEdit("ProductKeywords","S_ProductName","OR","Includes",0);
$WADbSearch1->addComparisonFromEdit("ProductShortDesc","S_ProductName","OR","Includes",0);
After all of this filtering, still, when a user types a name that matches products (ProductExclusiveFire=1) the results still appear with the rest.
When a user selects a category, no ExclusiveFire products appear, but when typing a search term, ExclusiveFire products appear. Here is an example of search results which bring up both normal products and ExclusiveFire products (denoted by the flame icon).
My question is this : What would cause "fire exclusive products" appear in the search results despite these efforts to filter them out? Attached is the Results.php page. Any assistance is greatly appreciated.
- Benjamin