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

Leaderboard

Popular Content

Showing content with the highest reputation on 11/04/2023 in Posts

  1. Покроковий підбір по категоріях але тільки під 2.3. Під OpenCart 3.x потрібно переробити або звернутись до розробника, він мав би допомогти з версією під 3.x.
    1 point
  2. Файл catalog/model/extension/shipping/weight.php Удалить выделенное https://prnt.sc/ld334e6jMIIF
    1 point
  3. Всім дякую!! Мені допоміг подолати цю проблему https://opencartforum.com/profile/850939-droc/ Він адаптував мій сайт під wepb, зараз в мене все коректно завантажується через АОП та відображається на сайті фото з цім WEPB долбаним
    1 point
  4. https://prnt.sc/26w2d9a в сео шаблоне все включено?
    1 point
  5. Примерный костяк: В шаблон пилите такое: <div id="form"> <form id="z"> <input type="text" placeholder="Ваше имя" name="n"> <input type="text" placeholder="+38(__)___-__-__" name="t"> <textarea placeholder="Комментарий" name="c"></textarea> <div class="send_form">Отправить</div> </form> </div> <script type="text/javascript"><!-- $('.send_form').click(function() { $.ajax({ url: 'index.php?route=common/header/send_form', //сюда пишите путь к контроллеру куда вставим код ниже type: 'post', data: $('#z input, #z textarea'), dataType: 'json', success: function(json) { if(json['error']){ alert(json['error']); } if(json['success']){ $('.send_form').hide(); $('.send_form').before('<span class="succ" style="color:green;font-weight:bold;">Вы успешно отправили заявку!</span>'); setTimeout (function(){ $('.succ').remove(); $('.send_form').show('600'); }, 3000); } } }); }); //--></script> И в контроллер такое: public function send_form() { $json = array(); if ($this->request->server['REQUEST_METHOD'] == 'POST') { if ((utf8_strlen($this->request->post['t']) < 6) || (utf8_strlen($this->request->post['t']) > 2500)) { $json['error'] = 'Заполните пожалуйста номер телефона'; } if ((utf8_strlen($this->request->post['n']) < 3) || (utf8_strlen($this->request->post['n']) > 2500)) { $json['error'] = 'Пожалуйста, укажите Ваше имя'; } $text = ''; if (!isset($json['error'])) { //send form if(!$this->request->post['c']) $this->request->post['n'] = 'Аноним'; $html = '<h3>Письмо от '.$this->request->post['n'].'</h3>'; if($this->request->post['n'])$html .= '<p><b>Имя:</b> '.$this->request->post['n'].'</p>'; $html .= '<p><b>Телефон:</b> '.$this->request->post['t'].'</p>'; if($this->request->post['c']) $html .= '<p><b>Комментарий:</b> '.$this->request->post['c'].'</p>'; $mail = new Mail(); $mail->protocol = $this->config->get('config_mail_protocol'); $mail->parameter = $this->config->get('config_mail_parameter'); $mail->hostname = $this->config->get('config_smtp_host'); $mail->username = $this->config->get('config_smtp_username'); $mail->password = $this->config->get('config_smtp_password'); $mail->port = $this->config->get('config_smtp_port'); $mail->timeout = $this->config->get('config_smtp_timeout'); $mail->setTo($this->config->get('config_email')); $mail->setFrom($this->config->get('config_email')); $mail->setSender($this->request->post['n']); $mail->setSubject(html_entity_decode('Тема письма от '.$this->request->post['n'], ENT_QUOTES, 'UTF-8')); $mail->setHtml($html); $mail->setText(html_entity_decode($text, ENT_QUOTES, 'UTF-8')); $mail->send(); $json['success'] = true; } } $this->response->setOutput(json_encode($json)); } Схема упрощена до безобразия - но главное что все отлично работает.
    1 point
Guest
×
  • 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.