Автозамены регионов

This commit is contained in:
Konstantin
2026-05-30 17:43:37 +03:00
parent df8cf22112
commit 6c8a012702
16 changed files with 317 additions and 18 deletions
+8 -1
View File
@@ -16,7 +16,7 @@ class ControllerCommonFooter extends Controller {
}
}
$data['contact'] = $this->url->link('information/contact');
$data['contact'] = $this->url->link('information/contact', '', true);
$data['return'] = $this->url->link('account/return/add', '', true);
$data['sitemap'] = $this->url->link('information/sitemap');
$data['tracking'] = $this->url->link('information/tracking');
@@ -28,6 +28,7 @@ class ControllerCommonFooter extends Controller {
$data['order'] = $this->url->link('account/order', '', true);
$data['wishlist'] = $this->url->link('account/wishlist', '', true);
$data['newsletter'] = $this->url->link('account/newsletter', '', true);
$data['text_contacts'] = $this->language->get('text_contacts');
$data['powered'] = sprintf($this->language->get('text_powered'), $this->config->get('config_name'), date('Y', time()));
@@ -60,6 +61,12 @@ foreach(['name','email','telephone','address','open', 'comment'] as $item){
$data['config_' . $item] = $this->config->get('config_' . $item);
}
$this->load->model('localisation/zone');
foreach ($this->model_localisation_zone->getContacts() as $field => $value) {
$data['config_' . $field] = $value;
}
$data['scripts'] = $this->document->getScripts('footer');
$data['styles'] = $this->document->getStyles('footer');
@@ -109,6 +109,13 @@ foreach(['name','email','telephone','address','open', 'comment'] as $item){
$zones = $this->model_localisation_zone->getZonesByCountryId($country_id);
$current_zone_id = isset($this->session->data['city_id']) ? (int)$this->session->data['city_id'] : (int)$this->config->get('config_zone_id');
$contacts = $this->model_localisation_zone->getContacts($current_zone_id);
foreach ($contacts as $field => $value) {
$data['config_' . $field] = $value;
}
$data['telephone'] = $contacts['telephone'];
$data['current_city_name'] = '';
foreach ($zones as $zone) {
@@ -4,6 +4,9 @@ class ControllerInformationContact extends Controller {
public function index() {
$this->load->language('information/contact');
$this->load->model('localisation/zone');
$contacts = $this->model_localisation_zone->getContacts();
$this->document->setTitle($this->language->get('heading_title'));
@@ -18,7 +21,7 @@ class ControllerInformationContact extends Controller {
$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->setTo($contacts['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'));
@@ -89,13 +92,13 @@ class ControllerInformationContact extends Controller {
}
$data['store'] = $this->config->get('config_name');
$data['address'] = nl2br($this->config->get('config_address'));
$data['geocode'] = $this->config->get('config_geocode');
$data['address'] = nl2br($contacts['address']);
$data['geocode'] = $contacts['geocode'];
$data['geocode_hl'] = $this->config->get('config_language');
$data['telephone'] = $this->config->get('config_telephone');
$data['fax'] = $this->config->get('config_fax');
$data['open'] = nl2br($this->config->get('config_open'));
$data['comment'] = $this->config->get('config_comment');
$data['telephone'] = $contacts['telephone'];
$data['fax'] = $contacts['fax'];
$data['open'] = nl2br($contacts['open']);
$data['comment'] = $contacts['comment'];
$data['locations'] = array();
@@ -0,0 +1,8 @@
<?php
class ControllerStartupRegionReplacement extends Controller {
public function index() {
$this->load->model('localisation/zone');
$this->response->setReplacements($this->model_localisation_zone->getReplacements());
}
}