if (($orderPosition === null ||
$orderPosition->
getQuantity() !==
(int) $data['quantity'
]) &&
$this->
hasProductGraduatedPrices($data['articleNumber'
],
$order) ) { $data =
$this->
checkPrice($data,
$order,
$shopContext);
} $variant =
$this->
getManager()->
getRepository(ProductVariant::
class) ->
findOneBy(['number' =>
$data['articleNumber'
]]);
// Load ean, unit and pack unit (translate if needed)
if ($variant instanceof ProductVariant
) { $mainVariant =
$variant->
getArticle()->
getMainDetail();
$data['ean'
] =
$variant->
getEan();
if (!\
is_string($data['ean'
]) &&
$mainVariant instanceof ProductVariant
) { $data['ean'
] =
$mainVariant->
getEan();
} $unit =
$variant->
getUnit();
if (!
$unit instanceof Unit &&
$mainVariant instanceof ProductVariant
) { $unit =
$mainVariant->
getUnit();
} $data['unit'
] =
$unit instanceof Unit ?
$unit->
getName() : null;
$data['packunit'
] =
$variant->
getPackUnit();
if (!\
is_string($data['packunit'
]) &&
$mainVariant instanceof ProductVariant
) {