RangeFacetResult example

$method = 'get' . ucfirst($maxField);
            $activeMax = $condition->$method();
        }

        if ($min === $max) {
            return null;
        }

        $label = $facet->getLabel() ?? '';

        return new RangeFacetResult(
            $name,
            $criteria->hasCondition($name),
            $label,
            $min,
            $max,
            $activeMin,
            $activeMax,
            $minField,
            $maxField,
            [],
            $facet->getSuffix(),
            
$activeMax = $max;

        $condition = $criteria->getCondition($criteriaPart->getName());
        if ($condition instanceof ProductAttributeCondition) {
            $value = $condition->getValue();
            if (\is_array($value)) {
                $activeMin = $value['min'];
                $activeMax = $value['max'];
            }
        }

        return new RangeFacetResult(
            $criteriaPart->getName(),
            $criteria->hasCondition($criteriaPart->getName()),
            $criteriaPart->getLabel(),
            $min,
            $max,
            $activeMin,
            $activeMax,
            'min' . $criteriaPart->getFormFieldName(),
            'max' . $criteriaPart->getFormFieldName(),
            [],
            $criteriaPart->getSuffix(),
            


        if ($min === $max) {
            return null;
        }

        $activeMin = round($activeMin$facet->getDigits());
        $activeMax = round($activeMax$facet->getDigits());

        $label = $facet->getLabel() ?? '';

        return new RangeFacetResult(
            $name,
            $criteria->hasCondition($name),
            $label,
            $min,
            $max,
            $activeMin,
            $activeMax,
            $minField,
            $maxField,
            [],
            $facet->getSuffix(),
            
$maxFieldName = $this->queryAliasMapper->getShortAlias('priceMax') ?? 'priceMax';

        $facet = $criteria->getFacet('price');
        if ($facet instanceof PriceFacet && !empty($facet->getLabel())) {
            $label = $facet->getLabel();
        } else {
            $label = $this->snippetManager
                ->getNamespace('frontend/listing/facet_labels')
                ->get('price', 'Price');
        }

        return new RangeFacetResult(
            'price',
            $criteria->hasCondition('price'),
            $label,
            $min,
            $max,
            $activeMin,
            $activeMax,
            $minFieldName,
            $maxFieldName,
            [],
            null,
            
$data = $condition->getValue();

            if (\is_array($data) && isset($data['min'])) {
                $activeMin = $data['min'];
            }

            if (\is_array($data) && isset($data['max'])) {
                $activeMax = $data['max'];
            }
        }

        return new RangeFacetResult(
            $facet->getName(),
            $criteria->hasCondition($facet->getName()),
            $facet->getLabel(),
            $result['minValues'],
            $result['maxValues'],
            $activeMin,
            $activeMax,
            'min' . $facet->getFormFieldName(),
            'max' . $facet->getFormFieldName(),
            [],
            $facet->getSuffix(),
            
if ($min === $max) {
            return null;
        }

        if (!empty($facet->getLabel())) {
            $label = $facet->getLabel();
        } else {
            $label = $this->snippetNamespace->get($facet->getName(), 'Price');
        }

        return new RangeFacetResult(
            $facet->getName(),
            $criteria->hasCondition($facet->getName()),
            $label,
            $min,
            $max,
            $activeMin,
            $activeMax,
            $this->minFieldName,
            $this->maxFieldName,
            [],
            null,
            
Home | Imprint | This part of the site doesn't use cookies.