Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazar65 committed Mar 29, 2019
1 parent 7cb0cf8 commit bbe71ef
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/code/Magento/CatalogSearch/Model/Layer/Filter/Decimal.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,9 @@ protected function _getItemsData()
$from = '';
}
if ($to == '*') {
$to = '';
$to = null;
}
$label = $this->renderRangeLabel(
empty($from) ? 0 : $from,
empty($to) ? $to : $to
);
$label = $this->renderRangeLabel(empty($from) ? 0 : $from, $to);
$value = $from . '-' . $to;

$data[] = [
Expand All @@ -141,7 +138,7 @@ protected function _getItemsData()
protected function renderRangeLabel($fromPrice, $toPrice)
{
$formattedFromPrice = $this->priceCurrency->format($fromPrice);
if ($toPrice === '') {
if ($toPrice === null) {
return __('%1 and above', $formattedFromPrice);
} else {
if ($fromPrice != $toPrice) {
Expand Down

0 comments on commit bbe71ef

Please sign in to comment.