OpenCart 🇺🇦

Схема

public mixed index ( )

Аргументы

Аргумент Возможный тип Описание
У метода нет аргументов

Описание

Метод пока еще не документирован.

Исходный код

$this->language->load('product/manufacturer');

$this->load->model('catalog/manufacturer');

$this->load->model('tool/image');		

$this->document->setTitle($this->language->get('heading_title'));

$this->data['heading_title'] = $this->language->get('heading_title');

$this->data['text_index'] = $this->language->get('text_index');
$this->data['text_empty'] = $this->language->get('text_empty');

$this->data['button_continue'] = $this->language->get('button_continue');

$this->data['breadcrumbs'] = array();

$this->data['breadcrumbs'][] = array(
	'text'      => $this->language->get('text_home'),
	'href'      => $this->url->link('common/home'),
	'separator' => false
);

$this->data['breadcrumbs'][] = array(
	'text'      => $this->language->get('text_brand'),
	'href'      => $this->url->link('product/manufacturer'),
	'separator' => $this->language->get('text_separator')
);

$this->data['categories'] = array();

$results = $this->model_catalog_manufacturer->getManufacturers();

foreach ($results as $result) {
	if (is_numeric(utf8_substr($result['name'], 0, 1))) {
		$key = '0 - 9';
	} else {
		$key = utf8_substr(utf8_strtoupper($result['name']), 0, 1);
	}

	if (!isset($this->data['manufacturers'][$key])) {
		$this->data['categories'][$key]['name'] = $key;
	}

	$this->data['categories'][$key]['manufacturer'][] = array(
		'name' => $result['name'],
		'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $result['manufacturer_id'])
	);
}

$this->data['continue'] = $this->url->link('common/home');

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/manufacturer_list.tpl')) {
	$this->template = $this->config->get('config_template') . '/template/product/manufacturer_list.tpl';
} else {
	$this->template = 'default/template/product/manufacturer_list.tpl';
}			

$this->children = array(
	'common/column_left',
	'common/column_right',
	'common/content_top',
	'common/content_bottom',
	'common/footer',
	'common/header'
);

$this->response->setOutput($this->render());