aboutsummaryrefslogtreecommitdiffstats
path: root/public/admin/controller/extension/total
diff options
context:
space:
mode:
Diffstat (limited to 'public/admin/controller/extension/total')
-rw-r--r--public/admin/controller/extension/total/coupon.php73
-rw-r--r--public/admin/controller/extension/total/credit.php73
-rw-r--r--public/admin/controller/extension/total/handling.php95
-rw-r--r--public/admin/controller/extension/total/klarna_fee.php113
-rw-r--r--public/admin/controller/extension/total/low_order_fee.php95
-rw-r--r--public/admin/controller/extension/total/reward.php73
-rw-r--r--public/admin/controller/extension/total/shipping.php79
-rw-r--r--public/admin/controller/extension/total/sub_total.php73
-rw-r--r--public/admin/controller/extension/total/tax.php73
-rw-r--r--public/admin/controller/extension/total/total.php73
-rw-r--r--public/admin/controller/extension/total/voucher.php87
11 files changed, 907 insertions, 0 deletions
diff --git a/public/admin/controller/extension/total/coupon.php b/public/admin/controller/extension/total/coupon.php
new file mode 100644
index 0000000..397e6cc
--- /dev/null
+++ b/public/admin/controller/extension/total/coupon.php
@@ -0,0 +1,73 @@
+<?php
+class ControllerExtensionTotalCoupon extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/coupon');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $this->model_setting_setting->editSetting('total_coupon', $this->request->post);
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/coupon', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/coupon', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ if (isset($this->request->post['total_coupon_status'])) {
+ $data['total_coupon_status'] = $this->request->post['total_coupon_status'];
+ } else {
+ $data['total_coupon_status'] = $this->config->get('total_coupon_status');
+ }
+
+ if (isset($this->request->post['total_coupon_sort_order'])) {
+ $data['total_coupon_sort_order'] = $this->request->post['total_coupon_sort_order'];
+ } else {
+ $data['total_coupon_sort_order'] = $this->config->get('total_coupon_sort_order');
+ }
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/coupon', $data));
+ }
+
+ protected function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/coupon')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+} \ No newline at end of file
diff --git a/public/admin/controller/extension/total/credit.php b/public/admin/controller/extension/total/credit.php
new file mode 100644
index 0000000..930d3cd
--- /dev/null
+++ b/public/admin/controller/extension/total/credit.php
@@ -0,0 +1,73 @@
+<?php
+class ControllerExtensionTotalCredit extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/credit');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $this->model_setting_setting->editSetting('total_credit', $this->request->post);
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/credit', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/credit', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ if (isset($this->request->post['total_credit_status'])) {
+ $data['total_credit_status'] = $this->request->post['total_credit_status'];
+ } else {
+ $data['total_credit_status'] = $this->config->get('total_credit_status');
+ }
+
+ if (isset($this->request->post['total_credit_sort_order'])) {
+ $data['total_credit_sort_order'] = $this->request->post['total_credit_sort_order'];
+ } else {
+ $data['total_credit_sort_order'] = $this->config->get('total_credit_sort_order');
+ }
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/credit', $data));
+ }
+
+ protected function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/credit')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+} \ No newline at end of file
diff --git a/public/admin/controller/extension/total/handling.php b/public/admin/controller/extension/total/handling.php
new file mode 100644
index 0000000..123906c
--- /dev/null
+++ b/public/admin/controller/extension/total/handling.php
@@ -0,0 +1,95 @@
+<?php
+class ControllerExtensionTotalHandling extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/handling');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $this->model_setting_setting->editSetting('total_handling', $this->request->post);
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/handling', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/handling', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ if (isset($this->request->post['total_handling_total'])) {
+ $data['total_handling_total'] = $this->request->post['total_handling_total'];
+ } else {
+ $data['total_handling_total'] = $this->config->get('total_handling_total');
+ }
+
+ if (isset($this->request->post['total_handling_fee'])) {
+ $data['total_handling_fee'] = $this->request->post['total_handling_fee'];
+ } else {
+ $data['total_handling_fee'] = $this->config->get('total_handling_fee');
+ }
+
+ if (isset($this->request->post['total_handling_tax_class_id'])) {
+ $data['total_handling_tax_class_id'] = $this->request->post['total_handling_tax_class_id'];
+ } else {
+ $data['total_handling_tax_class_id'] = $this->config->get('total_handling_tax_class_id');
+ }
+
+ $this->load->model('localisation/tax_class');
+
+ $data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();
+
+ if (isset($this->request->post['total_handling_status'])) {
+ $data['total_handling_status'] = $this->request->post['total_handling_status'];
+ } else {
+ $data['total_handling_status'] = $this->config->get('total_handling_status');
+ }
+
+ if (isset($this->request->post['total_handling_sort_order'])) {
+ $data['total_handling_sort_order'] = $this->request->post['total_handling_sort_order'];
+ } else {
+ $data['total_handling_sort_order'] = $this->config->get('total_handling_sort_order');
+ }
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/handling', $data));
+ }
+
+ protected function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/handling')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+} \ No newline at end of file
diff --git a/public/admin/controller/extension/total/klarna_fee.php b/public/admin/controller/extension/total/klarna_fee.php
new file mode 100644
index 0000000..95e9851
--- /dev/null
+++ b/public/admin/controller/extension/total/klarna_fee.php
@@ -0,0 +1,113 @@
+<?php
+class ControllerExtensionTotalKlarnaFee extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/klarna_fee');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $status = false;
+
+ foreach ($this->request->post['klarna_fee'] as $klarna_account) {
+ if ($klarna_account['status']) {
+ $status = true;
+
+ break;
+ }
+ }
+
+ $this->model_setting_setting->editSetting('total_klarna_fee', array_merge($this->request->post, array('klarna_fee_status' => $status)));
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/klarna_fee', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/klarna_fee', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ $data['countries'] = array();
+
+ $data['countries'][] = array(
+ 'name' => $this->language->get('text_germany'),
+ 'code' => 'DEU'
+ );
+
+ $data['countries'][] = array(
+ 'name' => $this->language->get('text_netherlands'),
+ 'code' => 'NLD'
+ );
+
+ $data['countries'][] = array(
+ 'name' => $this->language->get('text_denmark'),
+ 'code' => 'DNK'
+ );
+
+ $data['countries'][] = array(
+ 'name' => $this->language->get('text_sweden'),
+ 'code' => 'SWE'
+ );
+
+ $data['countries'][] = array(
+ 'name' => $this->language->get('text_norway'),
+ 'code' => 'NOR'
+ );
+
+ $data['countries'][] = array(
+ 'name' => $this->language->get('text_finland'),
+ 'code' => 'FIN'
+ );
+
+ if (isset($this->request->post['total_klarna_fee'])) {
+ $data['total_klarna_fee'] = $this->request->post['total_klarna_fee'];
+ } else {
+ $data['total_klarna_fee'] = $this->config->get('total_klarna_fee');
+ }
+
+ $this->load->model('localisation/tax_class');
+
+ $data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/klarna_fee', $data));
+ }
+
+ private function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/klarna_fee')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+} \ No newline at end of file
diff --git a/public/admin/controller/extension/total/low_order_fee.php b/public/admin/controller/extension/total/low_order_fee.php
new file mode 100644
index 0000000..5defd89
--- /dev/null
+++ b/public/admin/controller/extension/total/low_order_fee.php
@@ -0,0 +1,95 @@
+<?php
+class ControllerExtensionTotalLowOrderFee extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/low_order_fee');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $this->model_setting_setting->editSetting('total_low_order_fee', $this->request->post);
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/low_order_fee', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/low_order_fee', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ if (isset($this->request->post['total_low_order_fee_total'])) {
+ $data['total_low_order_fee_total'] = $this->request->post['total_low_order_fee_total'];
+ } else {
+ $data['total_low_order_fee_total'] = $this->config->get('total_low_order_fee_total');
+ }
+
+ if (isset($this->request->post['total_low_order_fee_fee'])) {
+ $data['total_low_order_fee_fee'] = $this->request->post['total_low_order_fee_fee'];
+ } else {
+ $data['total_low_order_fee_fee'] = $this->config->get('total_low_order_fee_fee');
+ }
+
+ if (isset($this->request->post['total_low_order_fee_tax_class_id'])) {
+ $data['total_low_order_fee_tax_class_id'] = $this->request->post['total_low_order_fee_tax_class_id'];
+ } else {
+ $data['total_low_order_fee_tax_class_id'] = $this->config->get('total_low_order_fee_tax_class_id');
+ }
+
+ $this->load->model('localisation/tax_class');
+
+ $data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();
+
+ if (isset($this->request->post['total_low_order_fee_status'])) {
+ $data['total_low_order_fee_status'] = $this->request->post['total_low_order_fee_status'];
+ } else {
+ $data['total_low_order_fee_status'] = $this->config->get('total_low_order_fee_status');
+ }
+
+ if (isset($this->request->post['total_low_order_fee_sort_order'])) {
+ $data['total_low_order_fee_sort_order'] = $this->request->post['total_low_order_fee_sort_order'];
+ } else {
+ $data['total_low_order_fee_sort_order'] = $this->config->get('total_low_order_fee_sort_order');
+ }
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/low_order_fee', $data));
+ }
+
+ protected function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/low_order_fee')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+} \ No newline at end of file
diff --git a/public/admin/controller/extension/total/reward.php b/public/admin/controller/extension/total/reward.php
new file mode 100644
index 0000000..eac07db
--- /dev/null
+++ b/public/admin/controller/extension/total/reward.php
@@ -0,0 +1,73 @@
+<?php
+class ControllerExtensionTotalReward extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/reward');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $this->model_setting_setting->editSetting('total_reward', $this->request->post);
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/reward', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/reward', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ if (isset($this->request->post['total_reward_status'])) {
+ $data['total_reward_status'] = $this->request->post['total_reward_status'];
+ } else {
+ $data['total_reward_status'] = $this->config->get('total_reward_status');
+ }
+
+ if (isset($this->request->post['total_reward_sort_order'])) {
+ $data['total_reward_sort_order'] = $this->request->post['total_reward_sort_order'];
+ } else {
+ $data['total_reward_sort_order'] = $this->config->get('total_reward_sort_order');
+ }
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/reward', $data));
+ }
+
+ protected function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/reward')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+} \ No newline at end of file
diff --git a/public/admin/controller/extension/total/shipping.php b/public/admin/controller/extension/total/shipping.php
new file mode 100644
index 0000000..ef7251d
--- /dev/null
+++ b/public/admin/controller/extension/total/shipping.php
@@ -0,0 +1,79 @@
+<?php
+class ControllerExtensionTotalShipping extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/shipping');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $this->model_setting_setting->editSetting('total_shipping', $this->request->post);
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/shipping', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/shipping', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ if (isset($this->request->post['total_shipping_estimator'])) {
+ $data['total_shipping_estimator'] = $this->request->post['total_shipping_estimator'];
+ } else {
+ $data['total_shipping_estimator'] = $this->config->get('total_shipping_estimator');
+ }
+
+ if (isset($this->request->post['total_shipping_status'])) {
+ $data['total_shipping_status'] = $this->request->post['total_shipping_status'];
+ } else {
+ $data['total_shipping_status'] = $this->config->get('total_shipping_status');
+ }
+
+ if (isset($this->request->post['total_shipping_sort_order'])) {
+ $data['total_shipping_sort_order'] = $this->request->post['total_shipping_sort_order'];
+ } else {
+ $data['total_shipping_sort_order'] = $this->config->get('total_shipping_sort_order');
+ }
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/shipping', $data));
+ }
+
+ protected function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/shipping')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+} \ No newline at end of file
diff --git a/public/admin/controller/extension/total/sub_total.php b/public/admin/controller/extension/total/sub_total.php
new file mode 100644
index 0000000..0bff1f8
--- /dev/null
+++ b/public/admin/controller/extension/total/sub_total.php
@@ -0,0 +1,73 @@
+<?php
+class ControllerExtensionTotalSubTotal extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/sub_total');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $this->model_setting_setting->editSetting('total_sub_total', $this->request->post);
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/sub_total', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/sub_total', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ if (isset($this->request->post['total_sub_total_status'])) {
+ $data['total_sub_total_status'] = $this->request->post['total_sub_total_status'];
+ } else {
+ $data['total_sub_total_status'] = $this->config->get('total_sub_total_status');
+ }
+
+ if (isset($this->request->post['sub_total_sort_order'])) {
+ $data['sub_total_sort_order'] = $this->request->post['sub_total_sort_order'];
+ } else {
+ $data['sub_total_sort_order'] = $this->config->get('sub_total_sort_order');
+ }
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/sub_total', $data));
+ }
+
+ protected function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/sub_total')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+} \ No newline at end of file
diff --git a/public/admin/controller/extension/total/tax.php b/public/admin/controller/extension/total/tax.php
new file mode 100644
index 0000000..89d3060
--- /dev/null
+++ b/public/admin/controller/extension/total/tax.php
@@ -0,0 +1,73 @@
+<?php
+class ControllerExtensionTotalTax extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/tax');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $this->model_setting_setting->editSetting('total_tax', $this->request->post);
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/tax', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/tax', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ if (isset($this->request->post['total_tax_status'])) {
+ $data['total_tax_status'] = $this->request->post['total_tax_status'];
+ } else {
+ $data['total_tax_status'] = $this->config->get('total_tax_status');
+ }
+
+ if (isset($this->request->post['total_tax_sort_order'])) {
+ $data['total_tax_sort_order'] = $this->request->post['total_tax_sort_order'];
+ } else {
+ $data['total_tax_sort_order'] = $this->config->get('total_tax_sort_order');
+ }
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/tax', $data));
+ }
+
+ protected function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/tax')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+} \ No newline at end of file
diff --git a/public/admin/controller/extension/total/total.php b/public/admin/controller/extension/total/total.php
new file mode 100644
index 0000000..3a24787
--- /dev/null
+++ b/public/admin/controller/extension/total/total.php
@@ -0,0 +1,73 @@
+<?php
+class ControllerExtensionTotalTotal extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/total');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $this->model_setting_setting->editSetting('total_total', $this->request->post);
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/total', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/total', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ if (isset($this->request->post['total_total_status'])) {
+ $data['total_total_status'] = $this->request->post['total_total_status'];
+ } else {
+ $data['total_total_status'] = $this->config->get('total_total_status');
+ }
+
+ if (isset($this->request->post['total_total_sort_order'])) {
+ $data['total_total_sort_order'] = $this->request->post['total_total_sort_order'];
+ } else {
+ $data['total_total_sort_order'] = $this->config->get('total_total_sort_order');
+ }
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/total', $data));
+ }
+
+ protected function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/total')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+} \ No newline at end of file
diff --git a/public/admin/controller/extension/total/voucher.php b/public/admin/controller/extension/total/voucher.php
new file mode 100644
index 0000000..0d7820b
--- /dev/null
+++ b/public/admin/controller/extension/total/voucher.php
@@ -0,0 +1,87 @@
+<?php
+class ControllerExtensionTotalVoucher extends Controller {
+ private $error = array();
+
+ public function index() {
+ $this->load->language('extension/total/voucher');
+
+ $this->document->setTitle($this->language->get('heading_title'));
+
+ $this->load->model('setting/setting');
+
+ if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
+ $this->model_setting_setting->editSetting('total_voucher', $this->request->post);
+
+ $this->session->data['success'] = $this->language->get('text_success');
+
+ $this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true));
+ }
+
+ if (isset($this->error['warning'])) {
+ $data['error_warning'] = $this->error['warning'];
+ } else {
+ $data['error_warning'] = '';
+ }
+
+ $data['breadcrumbs'] = array();
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_home'),
+ 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('text_extension'),
+ 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true)
+ );
+
+ $data['breadcrumbs'][] = array(
+ 'text' => $this->language->get('heading_title'),
+ 'href' => $this->url->link('extension/total/voucher', 'user_token=' . $this->session->data['user_token'], true)
+ );
+
+ $data['action'] = $this->url->link('extension/total/voucher', 'user_token=' . $this->session->data['user_token'], true);
+
+ $data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total', true);
+
+ if (isset($this->request->post['total_voucher_status'])) {
+ $data['total_voucher_status'] = $this->request->post['total_voucher_status'];
+ } else {
+ $data['total_voucher_status'] = $this->config->get('total_voucher_status');
+ }
+
+ if (isset($this->request->post['total_voucher_sort_order'])) {
+ $data['total_voucher_sort_order'] = $this->request->post['total_voucher_sort_order'];
+ } else {
+ $data['total_voucher_sort_order'] = $this->config->get('total_voucher_sort_order');
+ }
+
+ $data['header'] = $this->load->controller('common/header');
+ $data['column_left'] = $this->load->controller('common/column_left');
+ $data['footer'] = $this->load->controller('common/footer');
+
+ $this->response->setOutput($this->load->view('extension/total/voucher', $data));
+ }
+
+ protected function validate() {
+ if (!$this->user->hasPermission('modify', 'extension/total/voucher')) {
+ $this->error['warning'] = $this->language->get('error_permission');
+ }
+
+ return !$this->error;
+ }
+
+ public function install() {
+ // Register the event triggers
+ $this->load->model('setting/event');
+
+ $this->model_setting_event->addEvent('voucher', 'catalog/model/checkout/order/addOrderHistory/after', 'extension/total/voucher/send');
+ }
+
+ public function uninstall() {
+ // delete the event triggers
+ $this->load->model('setting/event');
+
+ $this->model_setting_event->deleteEventByCode('voucher');
+ }
+}