Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Ошибка в заказе


 Share

Recommended Posts

Добрый день, при открытии заказа в админке появляется ошибка в модальном окне notValid. В логах ошибка

2018-06-09 10:27:12 - PHP Notice:  Undefined index: email in /var/www/www-root/data/www/site.com/catalog/controller/extension/module/delivery.php on line 25
2018-06-09 10:27:12 - PHP Notice:  Undefined index: email in /var/www/www-root/data/www/site.com/catalog/controller/extension/module/delivery.php on line 28

Вот сам файл:

<?php  
class ControllerExtensionModuleDelivery extends Controller {
    
	public function index() 
        {           
		$this->language->load('extension/module/delivery');
		$this->load->model('extension/module/delivery');
             
		$data['heading_title'] = $this->language->get('heading_title');
		$data['textSuccess'] = $this->language->get('textSuccess');
		$data['textErrorEmeil'] = $this->language->get('textErrorEmeil');
		$data['textNotValid'] = $this->language->get('textNotValid');
		$data['textRegisterEmail'] = $this->language->get('textRegisterEmail');
                
              
                $data['action'] = $this->url->link('extension/module/delivery', '', 'SSL');                
                
                if ($this->request->server['REQUEST_METHOD'] == 'POST')
                    
                { 
                    if(!empty($this->request->post['name'])){
                        $name = $this->request->post['name'];
                    }
                    else{
                        $rez = explode('@', $this->request->post['email']);
                        $name = $rez[0];
                    }
                    $email = $this->request->post['email'];
                  
                    if($this->model_extension_module_delivery->validate($email) != 0)
                    {
                
                        $test = $this->model_extension_module_delivery->checkEmail($email);
                        if(empty($test))
                        {
                            $data = array();
                            
                            $data['email'] = $email;
                            $data['name'] = $name;                    
                            $this->model_extension_module_delivery->addData($data);                    
                            echo 'success';
                        }
                        else 
                        {
                            echo 'issetEmail';
                        }
                    }  
                    else
                    {
                        echo 'notValid';
                    }
                }
                return $this->load->view('extension/module/delivery', $data);
	}
}
?>

Что означает эта ошибка и как ее исправить? Спасибо)

Link to comment
Share on other sites

@aleksandrx100

в массиве $this->request->post нет ключа email
т.е. ожидаем получение почты из формы, но ее там нет

  • +1 1
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.