$definition =
$this->
buildDefinition($product,
$price,
$context,
$units,
$reference);
$calculated = CalculatedCheapestPrice::
createFrom( $this->calculator->
calculate($definition,
$context) );
$prices =
$product->
get('calculatedPrices'
);
$hasRange =
$prices instanceof CalculatedPriceCollection &&
$prices->
count() > 1;
$calculated->
setHasRange($hasRange);
$product->
assign(['calculatedCheapestPrice' =>
$calculated]);
return;
} $reference = ReferencePriceDto::
createFromCheapestPrice($cheapest);
$definition =
$this->
buildDefinition($product,
$cheapest->
getPrice(),
$context,
$units,
$reference);
$calculated = CalculatedCheapestPrice::
createFrom(