I am using OC 3.0.3.8
LE: Here's the extension I am using: https://www.opencart.com/index.php?rout ... n_id=37813
I want to mention that developer is not answering to emails.
Here is the code in catalog/controller/account/giftvoucher.php
Code: Select all
<?php
class ControllerAccountGiftvoucher extends Controller {
public function index() {
if (!$this->customer->isLogged()) {
$this->session->data['redirect'] = $this->url->link('account/giftvoucher', '', true);
$this->response->redirect($this->url->link('account/login', '', true));
}
$this->load->language('account/giftvoucher');
$this->document->setTitle($this->language->get('heading_title'));
$data['breadcrumbs'] = array();
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/home')
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_account'),
'href' => $this->url->link('account/account', '', true)
);
$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_giftvoucher'),
'href' => $this->url->link('account/giftvoucher', '', true)
);
$this->load->model('account/giftvoucher');
$resultsss = $this->model_account_giftvoucher->getGifttotal();
foreach ($resultsss as $result) {
$data['gifttotal'][] = array(
'voucher_id' => $result['voucher_id'],
'total' => $this->currency->format($result['total'], $this->config->get('config_currency'))
);
}
$results = $this->model_account_giftvoucher->getVouchergift();
foreach ($results as $result) {
if ($result['amount'] + (float)$result['used'] > 0) {
$data['vouchers'][] = array(
'voucher_id' => $result['voucher_id'],
'code' => $result['code'],
'from_name' => $result['from_name'],
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'amount' => $this->currency->format($result['amount'], $this->config->get('config_currency')),
);
}
}
$data['column_left'] = $this->load->controller('common/column_left');
$data['column_right'] = $this->load->controller('common/column_right');
$data['content_top'] = $this->load->controller('common/content_top');
$data['content_bottom'] = $this->load->controller('common/content_bottom');
$data['footer'] = $this->load->controller('common/footer');
$data['header'] = $this->load->controller('common/header');
$this->response->setOutput($this->load->view('account/giftvoucher', $data));
}
}