From 8a331cef40ae82a8cb93fbff00f5a6b04e171ceb Mon Sep 17 00:00:00 2001 From: Richard BAYET Date: Tue, 15 Mar 2022 08:24:59 +0100 Subject: [PATCH] Fixes #2434 Support false/zero value in catalog rules --- .../Model/Rule/Condition/Product/QueryBuilder.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/QueryBuilder.php b/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/QueryBuilder.php index 3b676e4c4..6c90d7384 100644 --- a/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/QueryBuilder.php +++ b/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/QueryBuilder.php @@ -80,7 +80,9 @@ public function getSearchQuery(ProductCondition $productCondition) $query = $this->getSpecialAttributesSearchQuery($productCondition); - if ($query === null && !empty($productCondition->getValue())) { + $conditionValue = $productCondition->getValue(); + $conditionValue = array_filter(is_array($conditionValue) ? $conditionValue : [$conditionValue], 'strlen'); + if ($query === null && !empty($conditionValue)) { $this->prepareFieldValue($productCondition); $queryType = QueryInterface::TYPE_TERMS; $queryParams = $this->getTermsQueryParams($productCondition);