private function refreshOrderProductBuyPrice(OrderProductInterface $orderProduct) { $baseBuyPrice = $orderProduct->getProduct()->getBuyPrice(); $baseCurrency = $baseBuyPrice->getCurrency(); $targetCurrency = $orderProduct->getOrder()->getCurrency(); $grossAmount = $this->currencyHelper->convert($baseBuyPrice->getGrossAmount(), $baseCurrency, $targetCurrency); $netAmount = $this->currencyHelper->convert($baseBuyPrice->getNetAmount(), $baseCurrency, $targetCurrency); $taxAmount = $this->currencyHelper->convert($baseBuyPrice->getTaxAmount(), $baseCurrency, $targetCurrency); $buyPrice = $this->priceFactory->create(); $buyPrice->setCurrency($targetCurrency); $buyPrice->setGrossAmount($grossAmount); $buyPrice->setNetAmount($netAmount); $buyPrice->setTaxAmount($taxAmount); $buyPrice->setTaxRate($baseBuyPrice->getTaxRate()); $orderProduct->setBuyPrice($buyPrice); }