public function getError($key = null)
    {
        if (isset($key)) {
            return gplcart_array_get($this->errors, $key);
        }

        return $this->errors;
    }
public function getError($key = null)
    {
        if (isset($key)) {
            return gplcart_array_get($this->errors, $key);
        }

        return $this->errors;
    }
public function getError ( $ key = null ) { if ( isset ( $ key ) ) { return gplcart_array_get ( $ this -> errors , $ key ) ; } return $ this -> errors ; }
Returns a single error or an array of all defined errors
@param null|string $key
@return mixed
Returns a single error or an array of all defined errors