Skip to content

magento2 custom price layred navigation

I have use below code but multi-select filter not working when i have before filter proper ranges show after filter ranges removed

dataProvider = $dataProvider;
$this->request = $request;
$this->options = $options;
}

/**
* Get items for the specified bucket and dimensions.
*
* @param BucketInterface $bucket The bucket for which to get items.
* @param array $dimensions Dimensions for the search.
* @param EntityStorage $entityStorage Storage for entities.
*
* @return array An array of items with counts and range values.
*/
public function getItems(BucketInterface $bucket, array $dimensions, EntityStorage $entityStorage)
{
$entityCount = count($entityStorage->getSource());
if ($entityCount dataProvider->getInterval($bucket, $dimensions, $entityStorage);

foreach (self::RANGES as $index => $range) {
$rangeResult = $interval->load($entityCount, null, $range[0], $range[1]);

$count = count($rangeResult);

if($count > 0){
$data[] = [
‘count’ => $count,
‘from’ => $range[0],
‘to’ => $range[1],
];
}

}

return $data;
}
}