Skip to content

Commit

Permalink
Fixed price filter when search by non-numeric value (#3136)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel authored and colinmollenhour committed Apr 17, 2023
1 parent 7584c1c commit 98464c6
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,10 @@ public function getCondition()
}
$rate = $this->_getRate($displayCurrency, $this->getColumn()->getCurrencyCode());

if (isset($value['from'])) {
$from = $value['from'] * $rate;
$value['from'] = sprintf('%F', $from);
}

if (isset($value['to'])) {
$to = $value['to'] * $rate;
$value['to'] = sprintf('%F', $to);
foreach (['from', 'to'] as $key) {
if (isset($value[$key]) && is_numeric($value[$key])) {
$value[$key] = sprintf('%F', $value[$key] * $rate);
}
}

$this->prepareRates($displayCurrency);
Expand Down

0 comments on commit 98464c6

Please sign in to comment.