public function addFacetToCollection($config = [])
{
$facetField = $this->getFilterField();
$facetType = BucketInterface::TYPE_HISTOGRAM;
$customerGroupId = $this->customerSession->getCustomerGroupId();
$facetConfig = ['nestedFilter' => ['price.customer_group_id' => $customerGroupId], 'minDocCount' => 1];
$calculation = $this->dataProvider->getRangeCalculationValue();
if ($calculation === \Magento\Catalog\Model\Layer\Filter\DataProvider\Price::RANGE_CALCULATION_MANUAL) {
if ((int) $this->dataProvider->getRangeStepValue() > 0) {
$facetConfig['interval'] = (int) $this->dataProvider->getRangeStepValue();
}
}
$productCollection = $this->getLayer()->getProductCollection();
$productCollection->addFacet($facetField, $facetType, $facetConfig);
return $this;
}