/** * If the cart's shipping amount is not defined, then put an empty Money * value * * @param CartInterface $cart Cart */ public function validateEmptyShippingAmount(CartInterface $cart) { $shippingAmount = $cart->getShippingAmount(); if (!$shippingAmount instanceof MoneyInterface) { $cart->setShippingAmount($this->emptyMoneyWrapper->get()); } }
/** * If the cart's shipping amount is not defined, then put an empty Money * value * * @param CartOnLoadEvent $event Event * * @return $this Self object */ public function checkEmptyShippingAmount(CartOnLoadEvent $event) { $cart = $event->getCart(); if (!$cart->getShippingAmount() instanceof Money) { $cart->setShippingAmount($this->emptyMoneyWrapper->get()); } return $this; }
/** * Returns a zero-initialized Money object * to be assigned to product prices. * * @return MoneyInterface */ protected function createZeroAmountMoney() { return $this->emptyMoneyWrapper->get(); }