if ($price->
getCurrencyId() !==
$context->
getCurrency()->
getId()) { $value *=
$context->
getContext()->
getCurrencyFactor();
} return $value;
} private function buildReferencePriceDefinition(ReferencePriceDto
$definition, UnitCollection
$units): ?ReferencePriceDefinition
{ if ( $definition->
getPurchase() === null
||
$definition->
getPurchase() <= 0
||
$definition->
getUnitId() === null
||
$definition->
getReference() === null
||
$definition->
getReference() <= 0
||
$definition->
getPurchase() ===
$definition->
getReference() ) { return null;
} $unit =
$units->
get($definition->
getUnitId());
if ($unit === null
) {