$this->load->model('catalog/product');
$product_gcategory = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_category WHERE product_id = '" . (int)$order_product['product_id'] . "'");
$product_category = $product_gcategory->row['category_id'];
$data['products'][] = array(
....
'href_cat' => $this->url->link('product/category&path='. $product_category),
....
{% for product in products %}
....
<a href="{{ product.href_cat}}"></a>
....
{% endfor %}
$filter_fields = array(
'LastUpdated',
'Vendor',
'Price',
);
.......
.......
$sorting_methods = array(
'' => array('query_order' => "`LastUpdated` $sort_dir, `Name` $sort_dir",
'title' => 'Новинки',
'query_select' => ''),
'Vendor' => array('query_order' => "`Vendor` $sort_dir, `Name` $sort_dir",
'title' => 'По алфавиту',
'query_select' => ''),
'price' => array('query_order' => "`__PriceRange` $sort_dir",
'title' => 'По цене',
'query_select' => "(IF(`Price` = 0 OR `$price_column` IS NULL," .
"(SELECT MIN(`$price_column`) FROM `Message$classID` AS pr WHERE pr.`Parent_Message_ID` = a.`Message_ID`), " .
"`Price`)) AS `__PriceRange`"),
);
$add_order_url = $nc_core->SUB_FOLDER . '/orders/add_order.html';
// Показывать в списке отключенные товары, если у них имеются включенные варианты:
$ignore_check = true;
$query_where = "(a.`Checked` = 1 OR (a.`Checked` = 0 AND (" .
"SELECT `Message_ID` FROM `Message$classID` as `child` " .
" WHERE `child`.`Parent_Message_ID` = a.`Message_ID` AND `child`.`Checked` = 1 " .
" LIMIT 1" .
")))";
$filter_fields = array(
'Vendor',
'Price',
);
// Инициализация и применение фильтра (кроме страницы объекта)
$netshop->filter->init_fields($filter_fields);
$netshop->filter->options('list_field', 'checkbox');
if ($action != 'full') {
$netshop->filter->query_where($query_where);
}
// Поля, которые отличают варианты друг от друга
$variant_fields = array(
);
// Строка, которая выводится вместо кнопки «В корзину», когда не выбран вариант товара
$select_variant_notification = "Выберите вариант товара";
// ID компонента аксессуаров
$accessories_component_id = null;
// Сортировка результатов
$sort_by = (string)$nc_core->input->fetch_get('sortBy');
$sort_dir = $nc_core->input->fetch_get('sortDesc')? 'DESC' : 'ASC';
$price_column = "Price";
$sorting_methods = array(
'' => array('query_order' => "`Vendor` $sort_dir, `Name` $sort_dir",
'title' => 'По алфавиту',
'query_select' => ''),
'price' => array('query_order' => "`__PriceRange` $sort_dir",
'title' => 'По цене',
'query_select' => "(IF(`Price` = 0 OR `$price_column` IS NULL," .
"(SELECT MIN(`$price_column`) FROM `Message$classID` AS pr WHERE pr.`Parent_Message_ID` = a.`Message_ID`), " .
"`Price`)) AS `__PriceRange`"),
);
if (isset($sorting_methods[$sort_by])) {
$query_order = $sorting_methods[$sort_by]['query_order'];
$query_select .= $sorting_methods[$sort_by]['query_select'];
}
if (!function_exists('current_link')) {
function current_link($params, $val = null) {
if (!is_array($params)) {
$params = array($params => ($val == '' ? null : $val));
}
if ($get = nc_core('input')->fetch_get()) {
$params = array_merge($get, $params);
}
global $cc_array, $cc, $sub;
if (sizeof($cc_array) == 1 || $cc_array[0] == $cc) {
return nc_folder_path($sub, null, $params);
}
else {
return nc_infoblock_path($cc, 'index', 'html', null, $params);
}
}
}
//отображение подкатегорий в категории
$ignore_sub=$ignore_cc=1;
$cursubs=join(",",nc_get_sub_children($current_sub['Subdivision_ID']));
$query_where = "a.Subdivision_ID IN ($cursubs)";
<? if (is_array($item['Slider']->records)): ?>
<? foreach ($item['Slider']->records as $record): ?>
<? $firstRecord = $item['Slider']->records[0]; ?>
<? endforeach; ?>
<img src="<?= $firstRecord['Path']; ?>" itemprop="image">
<? endif; ?>