protected function submitOrderCheckout()
    {
        if (!$this->isPosted('save')) {
            return null;
        }

        $errors = array();

        foreach (array('payment', 'shipping') as $type) {

            $address_errors = $this->validateAddressCheckout($type);

            if (!empty($address_errors)) {
                $errors = gplcart_array_merge($errors, $address_errors);
            }

            if (empty($address_errors)) {
                $this->addAddressCheckout($type);
            }
        }

        $order_errors = $this->validateOrderCheckout();
        $errors = gplcart_array_merge($errors, $order_errors);

        if (empty($errors)) {
            $this->addOrderCheckout();
        } else {
            $this->setError(null, $errors);
        }
    }
protected function submitOrderCheckout()
    {
        if (!$this->isPosted('save')) {
            return null;
        }

        $errors = array();

        foreach (array('payment', 'shipping') as $type) {

            $address_errors = $this->validateAddressCheckout($type);

            if (!empty($address_errors)) {
                $errors = gplcart_array_merge($errors, $address_errors);
            }

            if (empty($address_errors)) {
                $this->addAddressCheckout($type);
            }
        }

        $order_errors = $this->validateOrderCheckout();
        $errors = gplcart_array_merge($errors, $order_errors);

        if (empty($errors)) {
            $this->addOrderCheckout();
        } else {
            $this->setError(null, $errors);
        }
    }
protected function submitOrderCheckout ( ) { if ( ! $ this -> isPosted ( 'save' ) ) { return null ; } $ errors = array ( ) ; foreach ( array ( 'payment' , 'shipping' ) as $ type ) { $ address_errors = $ this -> validateAddressCheckout ( $ type ) ; if ( ! empty ( $ address_errors ) ) { $ errors = gplcart_array_merge ( $ errors , $ address_errors ) ; } if ( empty ( $ address_errors ) ) { $ this -> addAddressCheckout ( $ type ) ; } } $ order_errors = $ this -> validateOrderCheckout ( ) ; $ errors = gplcart_array_merge ( $ errors , $ order_errors ) ; if ( empty ( $ errors ) ) { $ this -> addOrderCheckout ( ) ; } else { $ this -> setError ( null , $ errors ) ; } }
Saves an order to the database
Saves an order to the database