1. Меняем API/Categories.php. Находим там функцию add_category (95) и добавляем ей дополнительный входной параметр, меняем:
Код: Выделить всё
public function add_category($category)
на
Код: Выделить всё
public function add_category($category, $copy_features = false)
и добавим после 125
Код: Выделить всё
$this->db->query("UPDATE __categories SET position=id WHERE id=?", $id);
следующее
Код: Выделить всё
if ($copy_features && $category['parent_id'] >= 0) {
$query = $this->db->placehold("INSERT INTO __categories_features SELECT ?, f.feature_id FROM __categories_features f WHERE f.category_id = ?", $id, $category['parent_id']);
$this->db->query($query);
}
2. Далее в /backend/core/CategoryAdmin.php и добавляем после 23
Код: Выделить всё
$category->description = $this->request->post('description');
следущее
Код: Выделить всё
$copy_features = $this->request->post('copy_features', 'boolean');
ниже на 38 находим
Код: Выделить всё
$category->id = $this->categories->add_category($category);
и меняем на
Код: Выделить всё
$category->id = $this->categories->add_category($category, $copy_features);
3. Открываем шаблон category.tpl и псле 106 добавляем
Код: Выделить всё
<div class="form-control">
<input type="checkbox" name="copy_features" id="copy_features" checked value="1">
<label for="copy_features">Скопировать свойства родителя</label>
</div>
ВСе