Skip to content

Commit 2d10ee8

Browse files
committed
ACP2E-316: Some product are missed from layered navigation with manually configured price ranges
1 parent 5763265 commit 2d10ee8

File tree

1 file changed

+5
-2
lines changed
  • lib/internal/Magento/Framework/Search/Dynamic/Algorithm

1 file changed

+5
-2
lines changed

lib/internal/Magento/Framework/Search/Dynamic/Algorithm/Manual.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(DataProviderInterface $dataProvider, OptionsInterfac
3333
}
3434

3535
/**
36-
* {@inheritdoc}
36+
* @inheritdoc
3737
*/
3838
public function getItems(
3939
BucketInterface $bucket,
@@ -51,13 +51,16 @@ public function getItems(
5151

5252
$aggregations = $this->dataProvider->getAggregations($entityStorage);
5353
if ($aggregations['max']) {
54-
$data[array_key_last($data)]['to'] = $aggregations['max'] + 0.01;
54+
$lastKey = array_key_last($data);
55+
$data[$lastKey]['to'] = max($data[$lastKey]['to'], $aggregations['max'] + 0.01);
5556
}
5657

5758
return $data;
5859
}
5960

6061
/**
62+
* Fix ranges according to maximum ranges number
63+
*
6164
* @param array $items
6265
* @param int $maxIntervalsNumber
6366
* @return array

0 commit comments

Comments
 (0)