/** * @return OrderTotal */ public function create() { $orderTotal = new OrderTotal(); $orderTotal->setGrossAmount(0); $orderTotal->setTaxRate(0); return $orderTotal; }
/** * Prepares order shipping details * * @param OrderInterface $order * @param ShippingMethodCostInterface $shippingMethodCost */ protected function prepareShippingTotals(OrderInterface $order, ShippingMethodCostInterface $shippingMethodCost) { $cost = $shippingMethodCost->getCost(); $baseCurrency = $cost->getCurrency(); $shippingTotal = new OrderTotal(); $shippingTotal->setGrossAmount($this->currencyHelper->convert($cost->getGrossAmount(), $baseCurrency, $order->getCurrency())); $shippingTotal->setNetAmount($this->currencyHelper->convert($cost->getNetAmount(), $baseCurrency, $order->getCurrency())); $shippingTotal->setTaxAmount($this->currencyHelper->convert($cost->getTaxAmount(), $baseCurrency, $order->getCurrency())); $shippingTotal->setTaxRate($this->currencyHelper->convert($cost->getTaxRate())); $shippingTotal->setCurrency($order->getCurrency()); $order->setShippingTotal($shippingTotal); }