OpenCart 🇺🇦

Схема

public mixed info ( )

Аргументы

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

Описание

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

Исходный код

$this->language->load('account/return');

if (isset($this->request->get['return_id'])) {
	$return_id = $this->request->get['return_id'];
} else {
	$return_id = 0;
}

if (!$this->customer->isLogged()) {
	$this->session->data['redirect'] = $this->url->link('account/return/info', 'return_id=' . $return_id, 'SSL');

	$this->redirect($this->url->link('account/login', '', 'SSL'));
}

$this->load->model('account/return');

$return_info = $this->model_account_return->getReturn($return_id);

if ($return_info) {
	$this->document->setTitle($this->language->get('text_return'));

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

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

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

	$url = '';

	if (isset($this->request->get['page'])) {
		$url .= '&page=' . $this->request->get['page'];
	}	

	$this->data['breadcrumbs'][] = array(
		'text'      => $this->language->get('heading_title'),
		'href'      => $this->url->link('account/return', $url, 'SSL'),
		'separator' => $this->language->get('text_separator')
	);

	$this->data['breadcrumbs'][] = array(
		'text'      => $this->language->get('text_return'),
		'href'      => $this->url->link('account/return/info', 'return_id=' . $this->request->get['return_id'] . $url, 'SSL'),
		'separator' => $this->language->get('text_separator')
	);			

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

	$this->data['text_return_detail'] = $this->language->get('text_return_detail');
	$this->data['text_return_id'] = $this->language->get('text_return_id');
	$this->data['text_order_id'] = $this->language->get('text_order_id');
	$this->data['text_date_ordered'] = $this->language->get('text_date_ordered');
	$this->data['text_customer'] = $this->language->get('text_customer');
	$this->data['text_email'] = $this->language->get('text_email');
	$this->data['text_telephone'] = $this->language->get('text_telephone');			
	$this->data['text_status'] = $this->language->get('text_status');
	$this->data['text_date_added'] = $this->language->get('text_date_added');
	$this->data['text_product'] = $this->language->get('text_product');
	$this->data['text_comment'] = $this->language->get('text_comment');
	$this->data['text_history'] = $this->language->get('text_history');

	$this->data['column_product'] = $this->language->get('column_product');
	$this->data['column_model'] = $this->language->get('column_model');
	$this->data['column_quantity'] = $this->language->get('column_quantity');
	$this->data['column_opened'] = $this->language->get('column_opened');
	$this->data['column_reason'] = $this->language->get('column_reason');
	$this->data['column_action'] = $this->language->get('column_action');
	$this->data['column_date_added'] = $this->language->get('column_date_added');
	$this->data['column_status'] = $this->language->get('column_status');
	$this->data['column_comment'] = $this->language->get('column_comment');

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

	$this->data['return_id'] = $return_info['return_id'];
	$this->data['order_id'] = $return_info['order_id'];
	$this->data['date_ordered'] = date($this->language->get('date_format_short'), strtotime($return_info['date_ordered']));
	$this->data['date_added'] = date($this->language->get('date_format_short'), strtotime($return_info['date_added']));
	$this->data['firstname'] = $return_info['firstname'];
	$this->data['lastname'] = $return_info['lastname'];
	$this->data['email'] = $return_info['email'];
	$this->data['telephone'] = $return_info['telephone'];						
	$this->data['product'] = $return_info['product'];
	$this->data['model'] = $return_info['model'];
	$this->data['quantity'] = $return_info['quantity'];
	$this->data['reason'] = $return_info['reason'];
	$this->data['opened'] = $return_info['opened'] ? $this->language->get('text_yes') : $this->language->get('text_no');
	$this->data['comment'] = nl2br($return_info['comment']);
	$this->data['action'] = $return_info['action'];

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

	$results = $this->model_account_return->getReturnHistories($this->request->get['return_id']);

	foreach ($results as $result) {
		$this->data['histories'][] = array(
			'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
			'status'     => $result['status'],
			'comment'    => nl2br($result['comment'])
		);
	}

	$this->data['continue'] = $this->url->link('account/return', $url, 'SSL');

	if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/return_info.tpl')) {
		$this->template = $this->config->get('config_template') . '/template/account/return_info.tpl';
	} else {
		$this->template = 'default/template/account/return_info.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());		
} else {
	$this->document->setTitle($this->language->get('text_return'));

	$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_account'),
		'href'      => $this->url->link('account/account', '', 'SSL'),
		'separator' => $this->language->get('text_separator')
	);

	$this->data['breadcrumbs'][] = array(
		'text'      => $this->language->get('heading_title'),
		'href'      => $this->url->link('account/return', '', 'SSL'),
		'separator' => $this->language->get('text_separator')
	);

	$url = '';

	if (isset($this->request->get['page'])) {
		$url .= '&page=' . $this->request->get['page'];
	}

	$this->data['breadcrumbs'][] = array(
		'text'      => $this->language->get('text_return'),
		'href'      => $this->url->link('account/return/info', 'return_id=' . $return_id . $url, 'SSL'),
		'separator' => $this->language->get('text_separator')
	);

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

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

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

	$this->data['continue'] = $this->url->link('account/return', '', 'SSL');

	$this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');

	if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
		$this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
	} else {
		$this->template = 'default/template/error/not_found.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());			
}