Разделение описания в категории товаров
This commit is contained in:
@@ -22,8 +22,8 @@ $_['column_action'] = 'Действие';
|
|||||||
|
|
||||||
// Entry
|
// Entry
|
||||||
$_['entry_name'] = 'Название категории';
|
$_['entry_name'] = 'Название категории';
|
||||||
$_['entry_description'] = 'Описание';
|
$_['entry_description_top'] = 'Описание Верх';
|
||||||
$_['entry_description_bottom'] = 'Описание Низ:';
|
$_['entry_description_bottom'] = 'Описание Низ';
|
||||||
$_['entry_meta_title'] = 'Мета-тег Title';
|
$_['entry_meta_title'] = 'Мета-тег Title';
|
||||||
$_['entry_meta_h1'] = 'HTML-тег H1';
|
$_['entry_meta_h1'] = 'HTML-тег H1';
|
||||||
$_['entry_meta_keyword'] = 'Мета-тег Keywords';
|
$_['entry_meta_keyword'] = 'Мета-тег Keywords';
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class ModelCatalogCategory extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($data['category_description'] as $language_id => $value) {
|
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
|
// 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 . "'");
|
$this->db->query("DELETE FROM " . DB_PREFIX . "category_description WHERE category_id = '" . (int)$category_id . "'");
|
||||||
|
|
||||||
foreach ($data['category_description'] as $language_id => $value) {
|
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
|
// MySQL Hierarchical Data Closure Table Pattern
|
||||||
@@ -348,12 +348,13 @@ class ModelCatalogCategory extends Model {
|
|||||||
|
|
||||||
foreach ($query->rows as $result) {
|
foreach ($query->rows as $result) {
|
||||||
$category_description_data[$result['language_id']] = array(
|
$category_description_data[$result['language_id']] = array(
|
||||||
'name' => $result['name'],
|
'name' => $result['name'],
|
||||||
'meta_title' => $result['meta_title'],
|
'meta_title' => $result['meta_title'],
|
||||||
'meta_h1' => $result['meta_h1'],
|
'meta_h1' => $result['meta_h1'],
|
||||||
'meta_description' => $result['meta_description'],
|
'meta_description' => $result['meta_description'],
|
||||||
'meta_keyword' => $result['meta_keyword'],
|
'meta_keyword' => $result['meta_keyword'],
|
||||||
'description' => $result['description']
|
'description' => $result['description'],
|
||||||
|
'description_bottom' => $result['description_bottom']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,11 +76,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<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">
|
<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>
|
</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>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</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'] = 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');
|
$data['compare'] = $this->url->link('product/compare');
|
||||||
|
|
||||||
$url = '';
|
$url = '';
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
<section class="products">
|
<section class="products">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
{% if description %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% if products %}
|
{% if products %}
|
||||||
<div class="row g-3 product-items">
|
<div class="row g-3 product-items">
|
||||||
@@ -90,8 +90,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if description %}
|
{% if description_bottom %}
|
||||||
<div class="text my-5">{{ description }}</div>
|
<div class="text my-5">{{ description_bottom }}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not categories and not products %}
|
{% if not categories and not products %}
|
||||||
<div class="py-4">
|
<div class="py-4">
|
||||||
|
|||||||
Vendored
Reference in New Issue
Block a user