/** * {@inheritdoc} */ public function calculateTotalTaxAmount(OrderInterface $order) { $amount = 0; $targetCurrency = $order->getCurrency(); $order->getProducts()->map(function (OrderProductInterface $orderProduct) use(&$amount, $targetCurrency) { $sellPrice = $orderProduct->getSellPrice(); $baseCurrency = $sellPrice->getCurrency(); $taxAmount = $sellPrice->getTaxAmount(); $amount += $this->currencyHelper->convert($taxAmount, $baseCurrency, $targetCurrency, $orderProduct->getQuantity()); }); return $amount; }