I found the issue. You check for if $field=' ' to determine if you want to search for it or not. This results in this query.
SELECT DISTINCT b.*
FROM #__hikashop_product_category AS a
LEFT JOIN #__hikashop_product AS b
ON a.product_id=b.product_id
WHERE b.product_published=1
AND b.product_type = 'main'
AND a.category_id IN (20)
AND (b.product_access = 'all' OR b.product_access LIKE '%,1,%')
AND (b.untergruppe LIKE '%none%')
AND (b.farbgruppe LIKE '%none%')
AND (b.bluetenmerkmale LIKE '%none%')
AND (b.duft LIKE '%none%')
AND (b.einmalmehrmalsbluehend LIKE '%none%')
AND (b.gesundheit LIKE '%none%')
AND (b.winterhaerte LIKE '%none%')
AND (b.hoehe LIKE '%none%')
AND (b.besondereeignung LIKE '%Schnittblume%')
AND (b.wuchsform LIKE '%none%')
AND (b.stammrosenverfuegbarkeit LIKE '%none%')
AND (b.pflanzabstand LIKE '%none%')
ORDER BY a.ordering ASC
LIMIT 0, 21
If I add a
then the query looks like
SELECT DISTINCT b.*
FROM #__hikashop_product_category AS a
LEFT JOIN #__hikashop_product AS b
ON a.product_id=b.product_id
WHERE b.product_published=1
AND b.product_type = 'main'
AND a.category_id IN (20)
AND (b.product_access = 'all' OR b.product_access LIKE '%,1,%')
AND (b.besondereeignung LIKE '%Schnittblume%')
ORDER BY a.ordering ASC
LIMIT 0, 21
Which works ...
In complete
foreach($infoGet as $field){
if($field!=$filter->filter_namekey && $field!=' ' && $field!='none'){
//$fieldsList.=' b.'.$filter->filter_options['custom_field'].' = '.$database->Quote($field).' OR';
$fieldsList[]='b.'.$filter->filter_options['custom_field'].' LIKE \'%'.hikashop_getEscaped($field,true).'%\'';
}
}