コード例 #1
0
 protected function recalculateShippingTotal(OrderInterface $order)
 {
     $grossAmount = $order->getShippingTotal()->getGrossAmount();
     $taxRate = $order->getShippingMethod()->getTax()->getValue();
     $currency = $order->getCurrency();
     $orderTotal = $this->orderTotalFactory->createFromSpecifiedValues($grossAmount, $taxRate, $currency);
     $order->setShippingTotal($orderTotal);
 }
コード例 #2
0
ファイル: OrderFactory.php プロジェクト: pguso/WellCommerce
 protected function prepareOrderShippingDetails(CartInterface $cart, OrderInterface $order)
 {
     $cost = $cart->getShippingMethodCost()->getCost();
     $grossAmount = $this->currencyHelper->convert($cost->getGrossAmount(), $cost->getCurrency(), $order->getCurrency());
     $taxRate = $cost->getTaxRate();
     $orderTotal = $this->orderTotalFactory->createFromSpecifiedValues($grossAmount, $taxRate, $order->getCurrency());
     $order->setShippingTotal($orderTotal);
 }