Skip to content

Commit ff22957

Browse files
authored
Fixed price filter when search by non-numeric value (#3136)
1 parent 59566f6 commit ff22957

File tree

1 file changed

+4
-8
lines changed
  • app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter

1 file changed

+4
-8
lines changed

app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Price.php

+4-8
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,10 @@ public function getCondition()
115115
}
116116
$rate = $this->_getRate($displayCurrency, $this->getColumn()->getCurrencyCode());
117117

118-
if (isset($value['from'])) {
119-
$from = $value['from'] * $rate;
120-
$value['from'] = sprintf('%F', $from);
121-
}
122-
123-
if (isset($value['to'])) {
124-
$to = $value['to'] * $rate;
125-
$value['to'] = sprintf('%F', $to);
118+
foreach (['from', 'to'] as $key) {
119+
if (isset($value[$key]) && is_numeric($value[$key])) {
120+
$value[$key] = sprintf('%F', $value[$key] * $rate);
121+
}
126122
}
127123

128124
$this->prepareRates($displayCurrency);

0 commit comments

Comments
 (0)