Разделение описания в категории товаров

This commit is contained in:
Konstantin
2026-05-30 10:59:19 +03:00
parent fc7ed88ef5
commit 1da999779b
6 changed files with 26 additions and 18 deletions
@@ -22,8 +22,8 @@ $_['column_action'] = 'Действие';
// Entry
$_['entry_name'] = 'Название категории';
$_['entry_description'] = 'Описание';
$_['entry_description_bottom'] = 'Описание Низ:';
$_['entry_description_top'] = 'Описание Верх';
$_['entry_description_bottom'] = 'Описание Низ';
$_['entry_meta_title'] = 'Мета-тег Title';
$_['entry_meta_h1'] = 'HTML-тег H1';
$_['entry_meta_keyword'] = 'Мета-тег Keywords';
+4 -3
View File
@@ -13,7 +13,7 @@ class ModelCatalogCategory extends Model {
}
foreach ($data['category_description'] as $language_id => $value) {
$this->db->query("INSERT INTO " . DB_PREFIX . "category_description SET category_id = '" . (int)$category_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', description = '" . $this->db->escape($value['description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "', meta_h1 = '" . $this->db->escape($value['meta_h1']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "'");
$this->db->query("INSERT INTO " . DB_PREFIX . "category_description SET category_id = '" . (int)$category_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', description = '" . $this->db->escape($value['description']) . "', description_bottom = '" . $this->db->escape($value['description_bottom']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "', meta_h1 = '" . $this->db->escape($value['meta_h1']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "'");
}
// MySQL Hierarchical Data Closure Table Pattern
@@ -89,7 +89,7 @@ class ModelCatalogCategory extends Model {
$this->db->query("DELETE FROM " . DB_PREFIX . "category_description WHERE category_id = '" . (int)$category_id . "'");
foreach ($data['category_description'] as $language_id => $value) {
$this->db->query("INSERT INTO " . DB_PREFIX . "category_description SET category_id = '" . (int)$category_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', description = '" . $this->db->escape($value['description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "', meta_h1 = '" . $this->db->escape($value['meta_h1']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "'");
$this->db->query("INSERT INTO " . DB_PREFIX . "category_description SET category_id = '" . (int)$category_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', description = '" . $this->db->escape($value['description']) . "', description_bottom = '" . $this->db->escape($value['description_bottom']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "', meta_h1 = '" . $this->db->escape($value['meta_h1']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "'");
}
// MySQL Hierarchical Data Closure Table Pattern
@@ -353,7 +353,8 @@ class ModelCatalogCategory extends Model {
'meta_h1' => $result['meta_h1'],
'meta_description' => $result['meta_description'],
'meta_keyword' => $result['meta_keyword'],
'description' => $result['description']
'description' => $result['description'],
'description_bottom' => $result['description_bottom']
);
}
@@ -76,9 +76,15 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="input-description{{ language.language_id }}">{{ entry_description }}</label>
<label class="col-sm-2 control-label" for="input-description{{ language.language_id }}">{{ entry_description_top }}</label>
<div class="col-sm-10">
<textarea name="category_description[{{ language.language_id }}][description]" placeholder="{{ entry_description }}" id="input-description{{ language.language_id }}" data-toggle="summernote" data-lang="{{ summernote }}" class="form-control">{{ category_description[language.language_id] ? category_description[language.language_id].description }}</textarea>
<textarea name="category_description[{{ language.language_id }}][description]" placeholder="{{ entry_description_top }}" id="input-description{{ language.language_id }}" data-toggle="summernote" data-lang="{{ summernote }}" class="form-control">{{ category_description[language.language_id] ? category_description[language.language_id].description }}</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="input-description-bottom{{ language.language_id }}">{{ entry_description_bottom }}</label>
<div class="col-sm-10">
<textarea name="category_description[{{ language.language_id }}][description_bottom]" placeholder="{{ entry_description_bottom }}" id="input-description-bottom{{ language.language_id }}" data-toggle="summernote" data-lang="{{ summernote }}" class="form-control">{{ category_description[language.language_id] ? category_description[language.language_id].description_bottom }}</textarea>
</div>
</div>
</div>
@@ -155,6 +155,7 @@ $this->document->addScript('store/view/theme/dominik/assets/js/swiper-bundle.js'
}
$data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');
$data['description_bottom'] = html_entity_decode($category_info['description_bottom'], ENT_QUOTES, 'UTF-8');
$data['compare'] = $this->url->link('product/compare');
$url = '';
@@ -71,7 +71,7 @@
<section class="products">
<div class="container-fluid">
{% if description %}
<div class="text mb-4 text-center">{{ description|split("</p>")[0] ~ '</p>' }}</div>
<div class="text mb-4 text-center">{{ description }}</div>
{% endif %}
{% if products %}
<div class="row g-3 product-items">
@@ -90,8 +90,8 @@
</div>
{% endif %}
{% if description %}
<div class="text my-5">{{ description }}</div>
{% if description_bottom %}
<div class="text my-5">{{ description_bottom }}</div>
{% endif %}
{% if not categories and not products %}
<div class="py-4">
View File