File tree 1 file changed +19
-0
lines changed
app/code/Magento/CatalogSearch/Model
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -368,6 +368,13 @@ protected function getPreparedSearchCriteria($attribute, $value)
368
368
if (!empty ($ value ['from ' ]) || !empty ($ value ['to ' ])) {
369
369
$ from = '' ;
370
370
$ to = '' ;
371
+ if (is_array ($ value ['from ' ])) {
372
+ $ value ['from ' ] = $ this ->getFirstArrayElement ($ value ['from ' ]);
373
+ }
374
+ if (is_array ($ value ['to ' ])) {
375
+ $ value ['to ' ] = $ this ->getFirstArrayElement ($ value ['to ' ]);
376
+ }
377
+
371
378
if (isset ($ value ['currency ' ])) {
372
379
/** @var $currencyModel Currency */
373
380
$ currencyModel = $ this ->_currencyFactory ->create ()->load ($ value ['currency ' ]);
@@ -433,4 +440,16 @@ public function getSearchCriterias()
433
440
{
434
441
return $ this ->_searchCriterias ;
435
442
}
443
+
444
+ /**
445
+ * Return first value in array
446
+ *
447
+ * @param $value
448
+ *
449
+ * @return mixed
450
+ */
451
+ private function getFirstArrayElement ($ value )
452
+ {
453
+ return is_array ($ value ) ? $ this ->getFirstArrayElement (array_shift ($ value )) : $ value ;
454
+ }
436
455
}
You can’t perform that action at this time.
0 commit comments