$this->data['heading_title'] = $this->language->get('heading_title');
$this->data['text_shipping'] = $this->language->get('text_shipping');
$this->data['text_payment'] = $this->language->get('text_payment');
$this->data['text_store'] = $this->language->get('text_store');
$this->data['entry_title'] = $this->language->get('entry_title');
$this->data['entry_description'] = $this->language->get('entry_description');
$this->data['entry_rate'] = $this->language->get('entry_rate');
$this->data['entry_based'] = $this->language->get('entry_based');
$this->data['entry_priority'] = $this->language->get('entry_priority');
$this->data['button_save'] = $this->language->get('button_save');
$this->data['button_cancel'] = $this->language->get('button_cancel');
$this->data['button_add_rule'] = $this->language->get('button_add_rule');
$this->data['button_remove'] = $this->language->get('button_remove');
if (isset($this->error['warning'])) {
$this->data['error_warning'] = $this->error['warning'];
} else {
$this->data['error_warning'] = '';
}
if (isset($this->error['title'])) {
$this->data['error_title'] = $this->error['title'];
} else {
$this->data['error_title'] = '';
}
if (isset($this->error['description'])) {
$this->data['error_description'] = $this->error['description'];
} else {
$this->data['error_description'] = '';
}
$url = '';
if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}
if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}
if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}
$this->data['breadcrumbs'] = array();
$this->data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
'separator' => false
);
$this->data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('localisation/tax_class', 'token=' . $this->session->data['token'] . $url, 'SSL'),
'separator' => ' :: '
);
if (!isset($this->request->get['tax_class_id'])) {
$this->data['action'] = $this->url->link('localisation/tax_class/insert', 'token=' . $this->session->data['token'] . $url, 'SSL');
} else {
$this->data['action'] = $this->url->link('localisation/tax_class/update', 'token=' . $this->session->data['token'] . '&tax_class_id=' . $this->request->get['tax_class_id'] . $url, 'SSL');
}
$this->data['cancel'] = $this->url->link('localisation/tax_class', 'token=' . $this->session->data['token'] . $url, 'SSL');
if (isset($this->request->get['tax_class_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
$tax_class_info = $this->model_localisation_tax_class->getTaxClass($this->request->get['tax_class_id']);
}
if (isset($this->request->post['title'])) {
$this->data['title'] = $this->request->post['title'];
} elseif (!empty($tax_class_info)) {
$this->data['title'] = $tax_class_info['title'];
} else {
$this->data['title'] = '';
}
if (isset($this->request->post['description'])) {
$this->data['description'] = $this->request->post['description'];
} elseif (!empty($tax_class_info)) {
$this->data['description'] = $tax_class_info['description'];
} else {
$this->data['description'] = '';
}
$this->load->model('localisation/tax_rate');
$this->data['tax_rates'] = $this->model_localisation_tax_rate->getTaxRates();
if (isset($this->request->post['tax_rule'])) {
$this->data['tax_rules'] = $this->request->post['tax_rule'];
} elseif (isset($this->request->get['tax_class_id'])) {
$this->data['tax_rules'] = $this->model_localisation_tax_class->getTaxRules($this->request->get['tax_class_id']);
} else {
$this->data['tax_rules'] = array();
}
$this->template = 'localisation/tax_class_form.tpl';
$this->children = array(
'common/header',
'common/footer',
);
$this->response->setOutput($this->render());