/**
  * {@inheritdoc}
  */
 public function visitOrder(OrderInterface $order)
 {
     $orderTotalDetail = $this->initResource();
     $shippingTotal = $order->getShippingTotal();
     $orderTotalDetail->setOrderTotal($shippingTotal);
     $orderTotalDetail->setOrder($order);
     $order->addTotal($orderTotalDetail);
 }
Ejemplo n.º 2
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);
 }