Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function insert()
- {
- $this->language->load('account/order');
- if (isset($this->request->get['order_id'])) {
- $order_id = $this->request->get['order_id'];
- } else {
- $order_id = 0;
- }
- if (!$this->customer->isLogged()) {
- $this->session->data['redirect'] = $this->url->link('account/order/info', 'order_id=' . $order_id, 'SSL');
- $this->redirect($this->url->link('account/login', '', 'SSL'));
- }
- $this->load->model('account/order');
- $order_info = $this->model_account_order->getOrder($order_id);
- $this->data['text_order_detail'] = $this->language->get('text_order_detail');
- $this->data['text_order_id'] = $this->language->get('text_order_id');
- $this->data['text_date_added'] = $this->language->get('text_date_added');
- $this->data['text_post_date'] = $this->language->get('text_post_date');
- $this->data['column_comment'] = $this->language->get('column_comment');
- $this->data['button_return'] = $this->language->get('button_return');
- $this->data['button_continue'] = $this->language->get('button_continue');
- if ($order_info['ttn']) {
- $this->data['ttn'] = $order_info['ttn'];
- } else {
- $this->data['ttn'] = '';
- }
- $this->data['order_id'] = $this->request->get['order_id'];
- $this->data['date_added'] = date($this->language->get('date_format_short'), strtotime($order_info['date_added']));
- $this->data['post_date'] = date($this->language->get('date_format_short'), strtotime($order_info['post_date']));
- $this->language->load('account/return');
- $this->load->model('account/return');
- if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
- $this->model_account_return->addReturn($this->request->post);
- $this->redirect($this->url->link('account/return/success', '', 'SSL'));
- }
- $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')
- );
- $this->data['breadcrumbs'][] = array(
- 'text' => $this->language->get('heading_title'),
- 'href' => $this->url->link('account/return/insert', '', 'SSL'),
- 'separator' => $this->language->get('text_separator')
- );
- $this->data['heading_title'] = $this->language->get('heading_title');
- $this->data['text_description'] = $this->language->get('text_description');
- $this->data['entry_order_id'] = $this->language->get('entry_order_id');
- $this->data['entry_date_ordered'] = $this->language->get('entry_date_ordered');
- $this->data['entry_reason'] = $this->language->get('entry_reason');
- $this->data['entry_fault_detail'] = $this->language->get('entry_fault_detail');
- $this->data['button_continue'] = $this->language->get('button_continue');
- $this->data['button_back'] = $this->language->get('button_back');
- if (isset($this->error['warning'])) {
- $this->data['error_warning'] = $this->error['warning'];
- } else {
- $this->data['error_warning'] = '';
- }
- if (isset($this->error['reason'])) {
- $this->data['error_reason'] = $this->error['reason'];
- } else {
- $this->data['error_reason'] = '';
- }
- if (isset($this->request->post['order_status_id'])) {
- $this->data['order_status_id'] = $this->request->post['order_status_id'];
- } else {
- $this->data['order_status_id'] = '';
- }
- $this->data['action'] = $this->url->link('account/return/insert', '', 'SSL');
- $this->load->model('localisation/return_reason');
- $this->data['return_reasons'] = $this->model_localisation_return_reason->getReturnReasons();
- if (isset($this->request->post['comment'])) {
- $this->data['comment'] = $this->request->post['comment'];
- } else {
- $this->data['comment'] = '';
- }
- $this->data['back'] = $this->url->link('account/account', '', 'SSL');
- if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/return_form.tpl')) {
- $this->template = $this->config->get('config_template') . '/template/account/return_form.tpl';
- } else {
- $this->template = 'default/template/account/return_form.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());
- }
Advertisement
Add Comment
Please, Sign In to add comment