OpenCart 🇺🇦

Схема

public mixed index ( )

Аргументы

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

Описание

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

Исходный код

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

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

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

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

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

$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')
);

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

$this->data['heading_title'] = $this->language->get('heading_title');
$this->data['column_created'] = $this->language->get('column_created');
$this->data['column_status'] = $this->language->get('column_status');
$this->data['column_product'] = $this->language->get('column_product');
$this->data['column_action'] = $this->language->get('column_action');
$this->data['column_profile_id'] = $this->language->get('column_profile_id');
$this->data['text_empty'] = $this->language->get('text_empty');
$this->data['button_view'] = $this->language->get('button_view');
$this->data['button_continue'] = $this->language->get('button_continue');

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

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

$recurring_total = $this->model_account_recurring->getTotalRecurring();

$results = $this->model_account_recurring->getAllProfiles(($page - 1) * 10, 10);

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

if($results){
	foreach ($results as $result) {
		$this->data['profiles'][] = array(
			'id'                    => $result['order_recurring_id'],
			'name'                  => $result['product_name'],
			'status'                => $result['status'],
			'created'               => date($this->language->get('date_format_short'), strtotime($result['created'])),
			'href'                  => $this->url->link('account/recurring/info','recurring_id='.$result['order_recurring_id'],'SSL'),
		);
	}
}

$this->data['status_types'] = array(
	1 => $this->language->get('text_status_inactive'),
	2 => $this->language->get('text_status_active'),
	3 => $this->language->get('text_status_suspended'),
	4 => $this->language->get('text_status_cancelled'),
	5 => $this->language->get('text_status_expired'),
	6 => $this->language->get('text_status_pending'),
);

$pagination = new Pagination();
$pagination->total = $recurring_total;
$pagination->page = $page;
$pagination->limit = 10;
$pagination->text = $this->language->get('text_pagination');
$pagination->url = $this->url->link('account/recurring', 'page={page}', 'SSL');

$this->data['pagination'] = $pagination->render();

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

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