Здравствуйте. Использую модуль simple и делаю следущее, в файл simpleregister.php добавляю такой код Код: if ($this->customer->isLogged()) { return; } $this->loadLibrary('simple/simplecheckout'); $this->simplecheckout = SimpleCheckout::getInstance($this->registry); $this->load->language('account/login'); $this->_templateData['error_login'] = ''; $this->_templateData['success'] = false; if ($this->request->server['REQUEST_METHOD'] == 'POST' && isset($this->request->post['login'])) { if (!empty($this->request->post['email']) && !empty($this->request->post['password']) && $this->customer->login($this->request->post['email'], $this->request->post['password'])) { unset($this->session->data['guest']); $this->_templateData['success'] = true; } else { $this->_templateData['error_login'] = $this->language->get('error_login'); } } $this->_templateData['heading_title'] = $this->language->get('heading_title'); $this->_templateData['text_new_customer'] = $this->language->get('text_new_customer'); $this->_templateData['text_register'] = $this->language->get('text_register'); $this->_templateData['text_register_account'] = $this->language->get('text_register_account'); $this->_templateData['text_returning_customer'] = $this->language->get('text_returning_customer'); $this->_templateData['text_i_am_returning_customer'] = $this->language->get('text_i_am_returning_customer'); $this->_templateData['text_forgotten'] = $this->language->get('text_forgotten'); $this->_templateData['entry_email'] = $this->language->get('entry_email'); $this->_templateData['entry_password'] = $this->language->get('entry_password'); $this->_templateData['button_continue'] = $this->language->get('button_continue'); $this->_templateData['button_login'] = $this->language->get('button_login'); $this->_templateData['forgotten'] = $this->url->link('account/forgotten', '', 'SSL'); if (isset($this->request->post['email'])) { $this->_templateData['email'] = trim($this->request->post['email']); } else { $this->_templateData['email'] = ''; } if (isset($this->request->post['password'])) { $this->_templateData['password'] = trim($this->request->post['password']); } else { $this->_templateData['password'] = ''; } В simpleregister.tpl вывожу Код: <div class="simplecheckout-block" id="slogin"> <div class="well"> <p><strong><?php echo $text_i_am_returning_customer; ?></strong></p> <?php if ($error_login) { ?> <div class="warning alert alert-danger"><?php echo $error_login ?></div> <?php } ?> <fieldset> <div class="form-group"> <label class="control-label" for="semail"><?php echo $entry_email; ?></label> <input type="text" value="<?php echo $email; ?>" placeholder="<?php echo $entry_email; ?>" id="semail" class="form-control" /> </div> <div class="form-group"> <label class="control-label" for="spassword"><?php echo $entry_password; ?></label> <input type="password" value="<?php echo $password; ?>" placeholder="<?php echo $entry_password; ?>" id="spassword" class="form-control" /> <a href="<?php echo $forgotten; ?>"><?php echo $text_forgotten; ?></a> </div> <input type="button" value="<?php echo $button_login; ?>" class="btn btn-primary" onclick="slogin()" /> </fieldset> </div> <?php if ($success) { ?> <script type="text/javascript"> location.reload(); </script> <?php } ?> </div> <script type="text/javascript"> function slogin() { $.ajax({ url: "index.php?route=account/simpleregister", data: "email=" + encodeURIComponent($("#semail").val()) + "&password=" + encodeURIComponent($("#spassword").val()) + "&login=1", type: "POST", dataType: "text", beforeSend: function() { }, success: function(data) { var newData = $(self.mainContainer, $(data)).get(0); if (!newData && data) { newData = data; } $("#slogin").replaceWith(newData); }, error: function(xhr, ajaxOptions, thrownError) { } }); } </script> Вроде все работает как нужно, за исключением того, что каждый раз после нажатие на кнопку "Вход" - страница дублируеться до бесконечности. Что я не правильно делаю? Спасибо всем заранее за любую подсказку и помощь
У автора спрашивал, он мне этот код выслал, на больше у него нет времени.. Этот код пробовал и на стандартной странице регистрации применить изменив в контроллер обявление переменных с _templateData на data, все работает так же, при нажатии на "Вход" - дублируеться вся страница до бесконечности при каждом нажатии.., поэтому думаю. что дело тут в неправильном ajax запросе либо я что то не учел...