public function submit(UserInterface $user, $locale, &$orderWasSubmitted = true, &$originalCart = null)
    {
        $orderWasSubmitted = true;

        $cart = $this->getUserCart($user, $locale, null, false, true);
        $originalCart = $cart;

        // In case of errors, do not submit cart.
        if (count($cart->getCartErrorCodes()) > 0) {
            $orderWasSubmitted = false;

            return $cart;
        }

        $orderWasSubmitted = $this->submitCartDirectly($cart, $user, $locale);

        return $this->getUserCart($user, $locale);
    }
public function submit(UserInterface $user, $locale, &$orderWasSubmitted = true, &$originalCart = null)
    {
        $orderWasSubmitted = true;

        $cart = $this->getUserCart($user, $locale, null, false, true);
        $originalCart = $cart;

        // In case of errors, do not submit cart.
        if (count($cart->getCartErrorCodes()) > 0) {
            $orderWasSubmitted = false;

            return $cart;
        }

        $orderWasSubmitted = $this->submitCartDirectly($cart, $user, $locale);

        return $this->getUserCart($user, $locale);
    }
public function submit ( UserInterface $ user , $ locale , & $ orderWasSubmitted = true , & $ originalCart = null ) { $ orderWasSubmitted = true ; $ cart = $ this -> getUserCart ( $ user , $ locale , null , false , true ) ; $ originalCart = $ cart ; // In case of errors, do not submit cart. if ( count ( $ cart -> getCartErrorCodes ( ) ) > 0 ) { $ orderWasSubmitted = false ; return $ cart ; } $ orderWasSubmitted = $ this -> submitCartDirectly ( $ cart , $ user , $ locale ) ; return $ this -> getUserCart ( $ user , $ locale ) ; }
Submits a cart.

@param UserInterface $user
@param string $locale
@param bool $orderWasSubmitted
@param OrderInterface $originalCart The original cart that was submitted

@throws OrderException
@throws EntityNotFoundException

@return null|ApiOrder
Submits a cart .