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(
181181 /**
182182 * Add advanced search filters to product collection
183183 *
184- * @param array $values
185- * @return $this
184+ * @param array $values
185+ * @return $this
186186 * @throws LocalizedException
187187 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
188188 * @SuppressWarnings(PHPMD.NPathComplexity)
@@ -197,6 +197,11 @@ public function addFilters($values)
197197 if (!isset ($ values [$ attribute ->getAttributeCode ()])) {
198198 continue ;
199199 }
200+ if ($ attribute ->getFrontendInput () == 'text ' || $ attribute ->getFrontendInput () == 'textarea ' ) {
201+ if (!trim ($ values [$ attribute ->getAttributeCode ()])) {
202+ continue ;
203+ }
204+ }
200205 $ value = $ values [$ attribute ->getAttributeCode ()];
201206 $ preparedSearchValue = $ this ->getPreparedSearchCriteria ($ attribute , $ value );
202207 if (false === $ preparedSearchValue ) {
@@ -343,9 +348,9 @@ protected function addSearchCriteria($attribute, $value)
343348 *
344349 * @todo: Move this code to block
345350 *
346- * @param EntityAttribute $attribute
347- * @param mixed $value
348- * @return string|bool
351+ * @param EntityAttribute $attribute
352+ * @param mixed $value
353+ * @return string|bool
349354 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
350355 * @SuppressWarnings(PHPMD.NPathComplexity)
351356 */
You can’t perform that action at this time.
0 commit comments