Skip to content

Commit

Permalink
Fixes #2434 Support false/zero value in catalog rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rbayet committed Mar 15, 2022
1 parent 7a25f34 commit df83a64
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,17 @@ public function __construct(
* @param ProductCondition $productCondition Product condition.
*
* @return \Smile\ElasticsuiteCore\Search\Request\QueryInterface
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function getSearchQuery(ProductCondition $productCondition)
{
$query = null;

$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);
Expand Down

0 comments on commit df83a64

Please sign in to comment.