Итак, все что написано в этой теме, мне подошло частично, перерыл много информации, в итоге получил то, что хотел.
Делал все на версии OCSTORE 1.5.4.1.2
Первый, второй и третий пункт как и в той теме остается таким же:
Итак:
Создаем дополнительное поле short_description в базе данных в таблице product_description. Располагаться оно должно перед полем description. Если не знаете как это сделать, посмотрите в этой статье.
Дальше идем по пути: магазин/admin/controller/catalog и открываем файл product.php
Ищем в нем строку
$this->data['entry_description'] = $this->language->get('entry_description');
После нее добавляем:
$this->data['entry_short_description'] = $this->language->get('entry_short_description');
Идем по пути: магазин/admin/language/russian/catalog и открываем файл product.php
Ищем строку
$_['entry_description'] = 'Описание:';
Перед ней добавляем:
$_['entry_short_description'] = 'Краткое описание:';
Идем по пути: магазин/admin/view/template/catalog и открываем файл product_form.tpl
Ищем:
<tr><td><?php echo $entry_description; ?></td><td><textarea name="product_description[<?php echo $language['language_id']; ?>][description]" id="description<?php echo $language['language_id']; ?>"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['description'] : ''; ?></textarea></td></tr>
Перед этим делом вставляем:
<tr><td><?php echo $entry_short_description; ?></td><td><textarea name="product_description[<?php echo $language['language_id']; ?>][short_description]" id="short_description<?php echo $language['language_id']; ?>"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['short_description'] : ''; ?></textarea></td></tr>
В этом же файле, для того, чтобы подключить CKEditor для краткого описания ищем:
<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script> <script type="text/javascript"><!--<?php foreach ($languages as $language) { ?>CKEDITOR.replace('description<?php echo $language['language_id']; ?>', {filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'});<?php } ?>//--></script>
И заменяем это дело на вот это:
<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script> <script type="text/javascript"><!--<?php foreach ($languages as $language) { ?>CKEDITOR.replace('short_description<?php echo $language['language_id']; ?>', {filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'});CKEDITOR.replace('description<?php echo $language['language_id']; ?>', {filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'});<?php } ?>//--></script>
Идем в магазин/catalog/model/catalog открываем файл product.php
Ищем строчку (У меня она 14)
$query = $this->db->query("SELECT DISTINCT *, pd.name AS name, p.image, m.name AS manufacturer, (SELECT price FROM " . DB_PREFIX . "product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '" . (int)$customer_group_id . "' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int)$customer_group_id . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM " . DB_PREFIX . "product_reward pr WHERE pr.product_id = p.product_id AND customer_group_id = '" . (int)$customer_group_id . "') AS reward, (SELECT ss.name FROM " . DB_PREFIX . "stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '" . (int)$this->config->get('config_language_id') . "') AS stock_status, (SELECT wcd.unit FROM " . DB_PREFIX . "weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS weight_class, (SELECT lcd.unit FROM " . DB_PREFIX . "length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS length_class, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'");
Заменяем ее на:
$query = $this->db->query("SELECT DISTINCT *, pd.short_description, pd.name AS name, p.image, m.name AS manufacturer, (SELECT price FROM " . DB_PREFIX . "product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '" . (int)$customer_group_id . "' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int)$customer_group_id . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM " . DB_PREFIX . "product_reward pr WHERE pr.product_id = p.product_id AND customer_group_id = '" . (int)$customer_group_id . "') AS reward, (SELECT ss.name FROM " . DB_PREFIX . "stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '" . (int)$this->config->get('config_language_id') . "') AS stock_status, (SELECT wcd.unit FROM " . DB_PREFIX . "weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS weight_class, (SELECT lcd.unit FROM " . DB_PREFIX . "length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS length_class, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'");
В этом же файле, чуть ниже находим строку:
'description' => $query->row['description'],
После нее дописываем:
'short_description' => $query->row['short_description'],
Идем по пути: магазин/admin/model/catalog открываем файл product.php
Ищем:
$this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "', seo_title = '" . $this->db->escape($value['seo_title']) . "', seo_h1 = '" . $this->db->escape($value['seo_h1']) . "'");Заменяем ее на: $this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', short_description = '" . $this->db->escape($value['short_description']) . "', description = '" . $this->db->escape($value['description']) . "', seo_title = '" . $this->db->escape($value['seo_title']) . "', seo_h1 = '" . $this->db->escape($value['seo_h1']) . "'");
В этом же файле ищем:
$this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "', seo_title = '" . $this->db->escape($value['seo_title']) . "', seo_h1 = '" . $this->db->escape($value['seo_h1']) . "'");
Заменяем на:
$this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', short_description = '" . $this->db->escape($value['short_description']) . "', description = '" . $this->db->escape($value['description']) . "', seo_title = '" . $this->db->escape($value['seo_title']) . "', seo_h1 = '" . $this->db->escape($value['seo_h1']) . "'");
В этом же файле ищем:
'meta_description' => $result['meta_description']
Ставим в конце строки запятую (Если не стоит) и ниже добавляем:
'short_description' => $result['short_description']
Теперь нам нужно вывести блок краткого описания, я выводил в категориях, поэтому идем по пути: магазин/catalog/controller/product открываем файл category.php
Ищем строчку
'product_id' => $result['product_id'],
После нее вставляем:
'short_description' => mb_substr(html_entity_decode($result['short_description'], ENT_QUOTES, 'UTF-8'), 0, 380),
Где 380 в моем случае максимальное колличество знаков в кратком описании
Далее идем в магазин/catalog/view/theme/ваш_шаблон/template/product открываем файл category.tpl
Ищем в нем:
<div class="description"><?php echo $product['description']; ?></div>
И заменяем ее на:
<div class="description"><?php echo $product['short_description']; ?></div>
Вроде бы все.
У меня вывод товаров идет сеткой, другие варианты не проверял, но думаю должно работать.
PS. Надеюсь все пути правильно написал, голова не варит уже :)