/** * 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()); } }