Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Отправка формы с полем "телефон"


Recommended Posts

Доброго времени суток! Кастомизировал форму в разгделе "Коникты", добавил туда поле "телефон", валидация проходит хорошо, но в письме телефона нет, поэтому подумал что видимо не хваиет метода для отправки :
 

<?php
class ControllerInformationContact extends Controller {
	private $error = array();

	public function index() {
		$this->load->language('information/contact');

		$this->document->setTitle($this->language->get('heading_title'));

		if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
			$mail = new Mail($this->config->get('config_mail_engine'));
			$mail->parameter = $this->config->get('config_mail_parameter');
			$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');
			$mail->smtp_username = $this->config->get('config_mail_smtp_username');
			$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');
			$mail->smtp_port = $this->config->get('config_mail_smtp_port');
			$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');

			$mail->setTo($this->config->get('config_email'));
			$mail->setFrom($this->request->post['email']);
			$mail->setReplyTo($this->request->post['email']);
			$mail->setSender(html_entity_decode($this->request->post['name'], ENT_QUOTES, 'UTF-8'));
			$mail->setSubject(html_entity_decode(sprintf($this->language->get('email_subject'), $this->request->post['name']), ENT_QUOTES, 'UTF-8'));
			$mail->setPhone($this->request->post['phone']);
			$mail->setText($this->request->post['enquiry']);
			$mail->send();

			$this->response->redirect($this->url->link('information/contact/success'));
		}

добавил метод setPhone, но не могу найти файл, ггде прописаны осильные методы....

И второй вопрос, на почту приходит письмо как на скрине, как сгделать его нормального вида?
 

Link to comment
Share on other sites


6 часов назад, Summersby сказал:

бавил метод setPhone, но не могу найти файл, ггде прописаны осильные методы....

бесполезно и не нужно добавлять этот метод поскольку его вообещё не суещёствует, в сам шаблон письма выводите ваш телефон, ну и диз тоже им же в шаблоне меняется

 

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.