File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
app/code/Magento/CatalogSearch/Model Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -181,8 +181,8 @@ public function __construct(
181
181
/**
182
182
* Add advanced search filters to product collection
183
183
*
184
- * @param array $values
185
- * @return $this
184
+ * @param array $values
185
+ * @return $this
186
186
* @throws LocalizedException
187
187
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
188
188
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -197,6 +197,11 @@ public function addFilters($values)
197
197
if (!isset ($ values [$ attribute ->getAttributeCode ()])) {
198
198
continue ;
199
199
}
200
+ if ($ attribute ->getFrontendInput () == 'text ' || $ attribute ->getFrontendInput () == 'textarea ' ) {
201
+ if (!trim ($ values [$ attribute ->getAttributeCode ()])) {
202
+ continue ;
203
+ }
204
+ }
200
205
$ value = $ values [$ attribute ->getAttributeCode ()];
201
206
$ preparedSearchValue = $ this ->getPreparedSearchCriteria ($ attribute , $ value );
202
207
if (false === $ preparedSearchValue ) {
@@ -343,9 +348,9 @@ protected function addSearchCriteria($attribute, $value)
343
348
*
344
349
* @todo: Move this code to block
345
350
*
346
- * @param EntityAttribute $attribute
347
- * @param mixed $value
348
- * @return string|bool
351
+ * @param EntityAttribute $attribute
352
+ * @param mixed $value
353
+ * @return string|bool
349
354
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
350
355
* @SuppressWarnings(PHPMD.NPathComplexity)
351
356
*/
You can’t perform that action at this time.
0 commit comments