first commit
This commit is contained in:
0
extension/index.html
Normal file
0
extension/index.html
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\OcThemeExample\Theme;
|
||||
class ThemeExample extends \Opencart\System\Engine\Controller {
|
||||
public function index(): void {
|
||||
$this->load->language('extension/oc_theme_example/theme/theme_example');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
if (isset($this->request->get['store_id'])) {
|
||||
$store_id = (int)$this->request->get['store_id'];
|
||||
} else {
|
||||
$store_id = 0;
|
||||
}
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=theme')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/oc_theme_example/theme/theme_example', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $store_id)
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/oc_theme_example/theme/theme_example.save', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $store_id);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=theme');
|
||||
|
||||
$data['theme_theme_example_status'] = $this->config->get('theme_theme_example_status');
|
||||
|
||||
$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/oc_theme_example/theme/theme_example', $data));
|
||||
}
|
||||
|
||||
public function save(): void {
|
||||
$this->load->language('extension/oc_theme_example/theme/theme_example');
|
||||
|
||||
if (isset($this->request->get['store_id'])) {
|
||||
$store_id = (int)$this->request->get['store_id'];
|
||||
} else {
|
||||
$store_id = 0;
|
||||
}
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/oc_theme_example/theme/theme_example')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('theme_theme_example', $this->request->post, $store_id);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
public function install(): void {
|
||||
if ($this->user->hasPermission('modify', 'extension/theme')) {
|
||||
// Add startup to catalog
|
||||
$startup_data = [
|
||||
'code' => 'theme_example',
|
||||
'description' => 'Example theme extension',
|
||||
'action' => 'catalog/extension/oc_theme_example/startup/theme_example',
|
||||
'status' => 1,
|
||||
'sort_order' => 2
|
||||
];
|
||||
|
||||
// Add startup for admin
|
||||
$this->load->model('setting/startup');
|
||||
|
||||
$this->model_setting_startup->addStartup($startup_data);
|
||||
}
|
||||
}
|
||||
|
||||
public function uninstall(): void {
|
||||
if ($this->user->hasPermission('modify', 'extension/theme')) {
|
||||
$this->load->model('setting/startup');
|
||||
|
||||
$this->model_setting_startup->deleteStartupByCode('theme_example');
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Example Theme';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified example theme!';
|
||||
$_['text_edit'] = 'Edit Example Theme';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify example theme!';
|
BIN
extension/oc_theme_example/admin/view/image/theme_example.png
Normal file
BIN
extension/oc_theme_example/admin/view/image/theme_example.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
@ -0,0 +1,35 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-theme" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fas fa-save"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fas fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fas fa-pencil-alt"></i> {{ text_edit }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-theme" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<div class="row mb-3">
|
||||
<label for="input-status" class="col-sm-2 col-form-label">{{ entry_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="theme_theme_example_status" value="0"/>
|
||||
<input type="checkbox" name="theme_theme_example_status" value="1" id="input-status" class="form-check-input"{% if theme_theme_example_status %} checked{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
namespace Opencart\Catalog\Controller\Extension\OcThemeExample\Startup;
|
||||
class ThemeExample extends \Opencart\System\Engine\Controller {
|
||||
public function index(): void {
|
||||
if ($this->config->get('config_theme') == 'theme_example' && $this->config->get('theme_theme_example_status')) {
|
||||
// Add event via code instead of DB
|
||||
// Could also just set view/common/header/before
|
||||
$this->event->register('view/*/before', new \Opencart\System\Engine\Action('extension/oc_theme_example/startup/theme_example.event'));
|
||||
}
|
||||
}
|
||||
|
||||
public function event(string &$route, array &$args, mixed &$output): void {
|
||||
$override = ['common/header'];
|
||||
|
||||
if (in_array($route, $override)) {
|
||||
$route = 'extension/oc_theme_example/' . $route;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
test header
|
6
extension/oc_theme_example/install.json
Normal file
6
extension/oc_theme_example/install.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "OpenCart Theme Example",
|
||||
"version": "1.0",
|
||||
"author": "OpenCart Ltd",
|
||||
"link": "https://www.opencart.com"
|
||||
}
|
5
extension/oc_theme_example/system/helper/test.php
Normal file
5
extension/oc_theme_example/system/helper/test.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
namespace Opencart\System\Helper\Extension\OcThemeExample;
|
||||
function my_function() {
|
||||
echo 'works';
|
||||
}
|
7
extension/oc_theme_example/system/library/my_class.php
Normal file
7
extension/oc_theme_example/system/library/my_class.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
namespace Opencart\System\Library\Extension\OcThemeExample;
|
||||
class MyClass {
|
||||
public function test() {
|
||||
echo 'I have been called!';
|
||||
}
|
||||
}
|
69
extension/opencart/admin/controller/captcha/basic.php
Normal file
69
extension/opencart/admin/controller/captcha/basic.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Captcha;
|
||||
/**
|
||||
* Class Basic
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Captch
|
||||
*/
|
||||
class Basic extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/captcha/basic');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/captcha/basic', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/captcha/basic.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=captcha');
|
||||
|
||||
$data['captcha_basic_status'] = $this->config->get('captcha_basic_status');
|
||||
|
||||
$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/opencart/captcha/basic', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/captcha/basic');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/captcha/basic')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('captcha_basic', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
132
extension/opencart/admin/controller/currency/ecb.php
Normal file
132
extension/opencart/admin/controller/currency/ecb.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Currency;
|
||||
/**
|
||||
* Class ECB
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Currency
|
||||
*/
|
||||
class ECB extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/currency/ecb');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/currency/ecb', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/currency/ecb.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency');
|
||||
|
||||
$data['currency_ecb_status'] = $this->config->get('currency_ecb_status');
|
||||
|
||||
$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/opencart/currency/ecb', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/currency/ecb');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/currency/ecb')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('currency_ecb', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $default
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function currency(string $default = ''): void {
|
||||
if ($this->config->get('currency_ecb_status')) {
|
||||
$curl = curl_init();
|
||||
|
||||
curl_setopt($curl, CURLOPT_URL, 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml');
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
|
||||
|
||||
$response = curl_exec($curl);
|
||||
|
||||
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
if ($status == 200) {
|
||||
$dom = new \DOMDocument('1.0', 'UTF-8');
|
||||
$dom->loadXml($response);
|
||||
|
||||
$cube = $dom->getElementsByTagName('Cube')->item(0);
|
||||
|
||||
$currencies = [];
|
||||
|
||||
$currencies['EUR'] = 1.0000;
|
||||
|
||||
foreach ($cube->getElementsByTagName('Cube') as $currency) {
|
||||
if ($currency->getAttribute('currency')) {
|
||||
$currencies[$currency->getAttribute('currency')] = $currency->getAttribute('rate');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($currencies[$default])) {
|
||||
$value = $currencies[$default];
|
||||
} else {
|
||||
$value = $currencies['EUR'];
|
||||
}
|
||||
|
||||
if ($currencies) {
|
||||
$this->load->model('localisation/currency');
|
||||
|
||||
$results = $this->model_localisation_currency->getCurrencies();
|
||||
|
||||
foreach ($results as $result) {
|
||||
if (isset($currencies[$result['code']])) {
|
||||
$this->model_localisation_currency->editValueByCode($result['code'], 1 / ($value * ($value / $currencies[$result['code']])));
|
||||
}
|
||||
}
|
||||
|
||||
$this->model_localisation_currency->editValueByCode($default, '1.00000');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->cache->delete('currency');
|
||||
}
|
||||
}
|
127
extension/opencart/admin/controller/currency/fixer.php
Normal file
127
extension/opencart/admin/controller/currency/fixer.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Currency;
|
||||
/**
|
||||
* Class Fixer
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Currency
|
||||
*/
|
||||
class Fixer extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/currency/fixer');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/currency/fixer', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/currency/fixer.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=currency');
|
||||
|
||||
$data['currency_fixer_api'] = $this->config->get('currency_fixer_api');
|
||||
$data['currency_fixer_status'] = $this->config->get('currency_fixer_status');
|
||||
|
||||
$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/opencart/currency/fixer', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/currency/fixer');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/currency/fixer')) {
|
||||
$json['error']['warning'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$this->request->post['currency_fixer_api']) {
|
||||
$json['error']['api'] = $this->language->get('error_api');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('currency_fixer', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $default
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function currency(string $default = ''): void {
|
||||
if ($this->config->get('currency_fixer_status')) {
|
||||
$curl = curl_init();
|
||||
|
||||
curl_setopt($curl, CURLOPT_URL, 'http://data.fixer.io/api/latest?access_key=' . $this->config->get('currency_fixer_api'));
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curl, CURLOPT_HEADER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 30);
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
|
||||
|
||||
$response = curl_exec($curl);
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
$response_info = json_decode($response, true);
|
||||
|
||||
if (is_array($response_info) && isset($response_info['rates'])) {
|
||||
// Compile all the rates into an array
|
||||
$currencies = [];
|
||||
|
||||
$currencies['EUR'] = 1.0000;
|
||||
|
||||
foreach ($response_info['rates'] as $key => $value) {
|
||||
$currencies[$key] = $value;
|
||||
}
|
||||
|
||||
$this->load->model('localisation/currency');
|
||||
|
||||
$results = $this->model_localisation_currency->getCurrencies();
|
||||
|
||||
foreach ($results as $result) {
|
||||
if (isset($currencies[$result['code']])) {
|
||||
$from = $currencies['EUR'];
|
||||
|
||||
$to = $currencies[$result['code']];
|
||||
|
||||
$this->model_localisation_currency->editValueByCode($result['code'], 1 / ($currencies[$default] * ($from / $to)));
|
||||
}
|
||||
}
|
||||
|
||||
$this->model_localisation_currency->editValueByCode($default, 1);
|
||||
|
||||
$this->cache->delete('currency');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
116
extension/opencart/admin/controller/dashboard/activity.php
Normal file
116
extension/opencart/admin/controller/dashboard/activity.php
Normal file
@ -0,0 +1,116 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Dashboard;
|
||||
/**
|
||||
* Class Activity
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Dashboard
|
||||
*/
|
||||
class Activity extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/dashboard/activity');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/dashboard/activity', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/dashboard/activity.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard');
|
||||
|
||||
$data['dashboard_activity_width'] = $this->config->get('dashboard_activity_width');
|
||||
|
||||
$data['columns'] = [];
|
||||
|
||||
for ($i = 3; $i <= 12; $i++) {
|
||||
$data['columns'][] = $i;
|
||||
}
|
||||
|
||||
$data['dashboard_activity_status'] = $this->config->get('dashboard_activity_status');
|
||||
$data['dashboard_activity_sort_order'] = $this->config->get('dashboard_activity_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/opencart/dashboard/activity_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/dashboard/activity');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/dashboard/activity')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('dashboard_activity', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function dashboard(): string {
|
||||
$this->load->language('extension/opencart/dashboard/activity');
|
||||
|
||||
$data['activities'] = [];
|
||||
|
||||
$this->load->model('extension/opencart/report/activity');
|
||||
|
||||
$results = $this->model_extension_opencart_report_activity->getActivities();
|
||||
|
||||
foreach ($results as $result) {
|
||||
$comment = vsprintf($this->language->get('text_activity_' . $result['key']), json_decode($result['data'], true));
|
||||
|
||||
$find = [
|
||||
'customer_id=',
|
||||
'order_id=',
|
||||
'return_id='
|
||||
];
|
||||
|
||||
$replace = [
|
||||
$this->url->link('customer/customer.form', 'user_token=' . $this->session->data['user_token'] . '&customer_id='),
|
||||
$this->url->link('sale/order.info', 'user_token=' . $this->session->data['user_token'] . '&order_id='),
|
||||
$this->url->link('sale/return.form', 'user_token=' . $this->session->data['user_token'] . '&return_id=')
|
||||
];
|
||||
|
||||
$data['activities'][] = [
|
||||
'comment' => str_replace($find, $replace, $comment),
|
||||
'date_added' => date($this->language->get('datetime_format'), strtotime($result['date_added']))
|
||||
];
|
||||
}
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/dashboard/activity_info', $data);
|
||||
}
|
||||
}
|
197
extension/opencart/admin/controller/dashboard/chart.php
Normal file
197
extension/opencart/admin/controller/dashboard/chart.php
Normal file
@ -0,0 +1,197 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Dashboard;
|
||||
/**
|
||||
* Class Chart
|
||||
*
|
||||
* @package
|
||||
*/
|
||||
class Chart extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/dashboard/chart');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/dashboard/chart', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/dashboard/chart.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard');
|
||||
|
||||
$data['dashboard_chart_width'] = $this->config->get('dashboard_chart_width');
|
||||
|
||||
$data['columns'] = [];
|
||||
|
||||
for ($i = 3; $i <= 12; $i++) {
|
||||
$data['columns'][] = $i;
|
||||
}
|
||||
|
||||
$data['dashboard_chart_status'] = $this->config->get('dashboard_chart_status');
|
||||
$data['dashboard_chart_sort_order'] = $this->config->get('dashboard_chart_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/opencart/dashboard/chart_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/dashboard/chart');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/dashboard/chart')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('dashboard_chart', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function dashboard(): string {
|
||||
$this->load->language('extension/opencart/dashboard/chart');
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/dashboard/chart_info', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function chart(): void {
|
||||
$this->load->language('extension/opencart/dashboard/chart');
|
||||
|
||||
$json = [];
|
||||
|
||||
$this->load->model('extension/opencart/report/customer');
|
||||
$this->load->model('extension/opencart/report/sale');
|
||||
|
||||
$json['order'] = [];
|
||||
$json['customer'] = [];
|
||||
$json['xaxis'] = [];
|
||||
|
||||
$json['order']['label'] = $this->language->get('text_order');
|
||||
$json['customer']['label'] = $this->language->get('text_customer');
|
||||
$json['order']['data'] = [];
|
||||
$json['customer']['data'] = [];
|
||||
|
||||
if (isset($this->request->get['range'])) {
|
||||
$range = $this->request->get['range'];
|
||||
} else {
|
||||
$range = 'day';
|
||||
}
|
||||
|
||||
switch ($range) {
|
||||
default:
|
||||
case 'day':
|
||||
$results = $this->model_extension_opencart_report_sale->getTotalOrdersByDay();
|
||||
|
||||
foreach ($results as $key => $value) {
|
||||
$json['order']['data'][] = [$key, $value['total']];
|
||||
}
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer->getTotalCustomersByDay();
|
||||
|
||||
foreach ($results as $key => $value) {
|
||||
$json['customer']['data'][] = [$key, $value['total']];
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 24; $i++) {
|
||||
$json['xaxis'][] = [$i, $i];
|
||||
}
|
||||
break;
|
||||
case 'week':
|
||||
$results = $this->model_extension_opencart_report_sale->getTotalOrdersByWeek();
|
||||
|
||||
foreach ($results as $key => $value) {
|
||||
$json['order']['data'][] = [$key, $value['total']];
|
||||
}
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer->getTotalCustomersByWeek();
|
||||
|
||||
foreach ($results as $key => $value) {
|
||||
$json['customer']['data'][] = [$key, $value['total']];
|
||||
}
|
||||
|
||||
$date_start = strtotime('-' . date('w') . ' days');
|
||||
|
||||
for ($i = 0; $i < 7; $i++) {
|
||||
$date = date('Y-m-d', $date_start + ($i * 86400));
|
||||
|
||||
$json['xaxis'][] = [date('w', strtotime($date)), date('D', strtotime($date))];
|
||||
}
|
||||
break;
|
||||
case 'month':
|
||||
$results = $this->model_extension_opencart_report_sale->getTotalOrdersByMonth();
|
||||
|
||||
foreach ($results as $key => $value) {
|
||||
$json['order']['data'][] = [$key, $value['total']];
|
||||
}
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer->getTotalCustomersByMonth();
|
||||
|
||||
foreach ($results as $key => $value) {
|
||||
$json['customer']['data'][] = [$key, $value['total']];
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= date('t'); $i++) {
|
||||
$date = date('Y') . '-' . date('m') . '-' . $i;
|
||||
|
||||
$json['xaxis'][] = [date('j', strtotime($date)), date('d', strtotime($date))];
|
||||
}
|
||||
break;
|
||||
case 'year':
|
||||
$results = $this->model_extension_opencart_report_sale->getTotalOrdersByYear();
|
||||
|
||||
foreach ($results as $key => $value) {
|
||||
$json['order']['data'][] = [$key, $value['total']];
|
||||
}
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer->getTotalCustomersByYear();
|
||||
|
||||
foreach ($results as $key => $value) {
|
||||
$json['customer']['data'][] = [$key, $value['total']];
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$json['xaxis'][] = [$i, date('M', mktime(0, 0, 0, $i, 1))];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
120
extension/opencart/admin/controller/dashboard/customer.php
Normal file
120
extension/opencart/admin/controller/dashboard/customer.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Dashboard;
|
||||
/**
|
||||
* Class Customer
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Dashboard
|
||||
*/
|
||||
class Customer extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/dashboard/customer');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/dashboard/customer', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/dashboard/customer.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard');
|
||||
|
||||
$data['dashboard_customer_width'] = $this->config->get('dashboard_customer_width');
|
||||
|
||||
$data['columns'] = [];
|
||||
|
||||
for ($i = 3; $i <= 12; $i++) {
|
||||
$data['columns'][] = $i;
|
||||
}
|
||||
|
||||
$data['dashboard_customer_status'] = $this->config->get('dashboard_customer_status');
|
||||
$data['dashboard_customer_sort_order'] = $this->config->get('dashboard_customer_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/opencart/dashboard/customer_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/dashboard/customer');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/dashboard/customer')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('dashboard_customer', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function dashboard(): string {
|
||||
$this->load->language('extension/opencart/dashboard/customer');
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
// Total Orders
|
||||
$this->load->model('customer/customer');
|
||||
|
||||
$today = $this->model_customer_customer->getTotalCustomers(['filter_date_added' => date('Y-m-d', strtotime('-1 day'))]);
|
||||
|
||||
$yesterday = $this->model_customer_customer->getTotalCustomers(['filter_date_added' => date('Y-m-d', strtotime('-2 day'))]);
|
||||
|
||||
$difference = $today - $yesterday;
|
||||
|
||||
if ($difference && $today) {
|
||||
$data['percentage'] = round(($difference / $today) * 100);
|
||||
} else {
|
||||
$data['percentage'] = 0;
|
||||
}
|
||||
|
||||
$customer_total = $this->model_customer_customer->getTotalCustomers();
|
||||
|
||||
if ($customer_total > 1000000000000) {
|
||||
$data['total'] = round($customer_total / 1000000000000, 1) . 'T';
|
||||
} elseif ($customer_total > 1000000000) {
|
||||
$data['total'] = round($customer_total / 1000000000, 1) . 'B';
|
||||
} elseif ($customer_total > 1000000) {
|
||||
$data['total'] = round($customer_total / 1000000, 1) . 'M';
|
||||
} elseif ($customer_total > 1000) {
|
||||
$data['total'] = round($customer_total / 1000, 1) . 'K';
|
||||
} else {
|
||||
$data['total'] = $customer_total;
|
||||
}
|
||||
|
||||
$data['customer'] = $this->url->link('customer/customer', 'user_token=' . $this->session->data['user_token']);
|
||||
|
||||
return $this->load->view('extension/opencart/dashboard/customer_info', $data);
|
||||
}
|
||||
}
|
110
extension/opencart/admin/controller/dashboard/map.php
Normal file
110
extension/opencart/admin/controller/dashboard/map.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Dashboard;
|
||||
/**
|
||||
* Class Map
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Dashboard
|
||||
*/
|
||||
class Map extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/dashboard/map');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/dashboard/map', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/dashboard/map.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard');
|
||||
|
||||
$data['dashboard_map_width'] = $this->config->get('dashboard_map_width');
|
||||
|
||||
$data['columns'] = [];
|
||||
|
||||
for ($i = 3; $i <= 12; $i++) {
|
||||
$data['columns'][] = $i;
|
||||
}
|
||||
|
||||
$data['dashboard_map_status'] = $this->config->get('dashboard_map_status');
|
||||
$data['dashboard_map_sort_order'] = $this->config->get('dashboard_map_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/opencart/dashboard/map_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/dashboard/map');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/dashboard/map')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('dashboard_map', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function dashboard(): string {
|
||||
$this->load->language('extension/opencart/dashboard/map');
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/dashboard/map_info', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function map(): void {
|
||||
$json = [];
|
||||
|
||||
$this->load->model('extension/opencart/dashboard/map');
|
||||
|
||||
$results = $this->model_extension_opencart_dashboard_map->getTotalOrdersByCountry();
|
||||
|
||||
foreach ($results as $result) {
|
||||
$json[strtolower($result['iso_code_2'])] = [
|
||||
'total' => $result['total'],
|
||||
'amount' => $this->currency->format($result['amount'], $this->config->get('config_currency'))
|
||||
];
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
106
extension/opencart/admin/controller/dashboard/online.php
Normal file
106
extension/opencart/admin/controller/dashboard/online.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Dashboard;
|
||||
/**
|
||||
* Class Online
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Dashboard
|
||||
*/
|
||||
class Online extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/dashboard/online');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/dashboard/online', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/dashboard/online.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard');
|
||||
|
||||
$data['dashboard_online_width'] = $this->config->get('dashboard_online_width');
|
||||
|
||||
$data['columns'] = [];
|
||||
|
||||
for ($i = 3; $i <= 12; $i++) {
|
||||
$data['columns'][] = $i;
|
||||
}
|
||||
|
||||
$data['dashboard_online_status'] = $this->config->get('dashboard_online_status');
|
||||
$data['dashboard_online_sort_order'] = $this->config->get('dashboard_online_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/opencart/dashboard/online_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/dashboard/online');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/dashboard/online')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('dashboard_online', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function dashboard(): string {
|
||||
$this->load->language('extension/opencart/dashboard/online');
|
||||
|
||||
$this->load->model('report/online');
|
||||
|
||||
// Customers Online
|
||||
$online_total = $this->model_report_online->getTotalOnline();
|
||||
|
||||
if ($online_total > 1000000000000) {
|
||||
$data['total'] = round($online_total / 1000000000000, 1) . 'T';
|
||||
} elseif ($online_total > 1000000000) {
|
||||
$data['total'] = round($online_total / 1000000000, 1) . 'B';
|
||||
} elseif ($online_total > 1000000) {
|
||||
$data['total'] = round($online_total / 1000000, 1) . 'M';
|
||||
} elseif ($online_total > 1000) {
|
||||
$data['total'] = round($online_total / 1000, 1) . 'K';
|
||||
} else {
|
||||
$data['total'] = $online_total;
|
||||
}
|
||||
|
||||
$data['online'] = $this->url->link('report/online', 'user_token=' . $this->session->data['user_token']);
|
||||
|
||||
return $this->load->view('extension/opencart/dashboard/online_info', $data);
|
||||
}
|
||||
}
|
121
extension/opencart/admin/controller/dashboard/order.php
Normal file
121
extension/opencart/admin/controller/dashboard/order.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Dashboard;
|
||||
/**
|
||||
* Class Order
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Dashboard
|
||||
*/
|
||||
class Order extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/dashboard/order');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/dashboard/order', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/dashboard/order.save', 'user_token=' . $this->session->data['user_token']);
|
||||
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard');
|
||||
|
||||
$data['dashboard_order_width'] = $this->config->get('dashboard_order_width');
|
||||
|
||||
$data['columns'] = [];
|
||||
|
||||
for ($i = 3; $i <= 12; $i++) {
|
||||
$data['columns'][] = $i;
|
||||
}
|
||||
|
||||
$data['dashboard_order_status'] = $this->config->get('dashboard_order_status');
|
||||
$data['dashboard_order_sort_order'] = $this->config->get('dashboard_order_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/opencart/dashboard/order_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/dashboard/order');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/dashboard/order')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('dashboard_order', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function dashboard(): string {
|
||||
$this->load->language('extension/opencart/dashboard/order');
|
||||
|
||||
// Total Orders
|
||||
$this->load->model('sale/order');
|
||||
|
||||
$today = $this->model_sale_order->getTotalOrders(['filter_date_added' => date('Y-m-d', strtotime('-1 day'))]);
|
||||
|
||||
$yesterday = $this->model_sale_order->getTotalOrders(['filter_date_added' => date('Y-m-d', strtotime('-2 day'))]);
|
||||
|
||||
$difference = $today - $yesterday;
|
||||
|
||||
if ($difference && $today) {
|
||||
$data['percentage'] = round(($difference / $today) * 100);
|
||||
} else {
|
||||
$data['percentage'] = 0;
|
||||
}
|
||||
|
||||
$order_total = $this->model_sale_order->getTotalOrders();
|
||||
|
||||
if ($order_total > 1000000000000) {
|
||||
$data['total'] = round($order_total / 1000000000000, 1) . 'T';
|
||||
} elseif ($order_total > 1000000000) {
|
||||
$data['total'] = round($order_total / 1000000000, 1) . 'B';
|
||||
} elseif ($order_total > 1000000) {
|
||||
$data['total'] = round($order_total / 1000000, 1) . 'M';
|
||||
} elseif ($order_total > 1000) {
|
||||
$data['total'] = round($order_total / 1000, 1) . 'K';
|
||||
} else {
|
||||
$data['total'] = $order_total;
|
||||
}
|
||||
|
||||
$data['order'] = $this->url->link('sale/order', 'user_token=' . $this->session->data['user_token']);
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/dashboard/order_info', $data);
|
||||
}
|
||||
}
|
114
extension/opencart/admin/controller/dashboard/recent.php
Normal file
114
extension/opencart/admin/controller/dashboard/recent.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Dashboard;
|
||||
/**
|
||||
* Class Recent
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Dashboard
|
||||
*/
|
||||
class Recent extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/dashboard/recent');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/dashboard/recent', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/dashboard/recent.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard');
|
||||
|
||||
$data['dashboard_recent_width'] = $this->config->get('dashboard_recent_width');
|
||||
|
||||
$data['columns'] = [];
|
||||
|
||||
for ($i = 3; $i <= 12; $i++) {
|
||||
$data['columns'][] = $i;
|
||||
}
|
||||
|
||||
$data['dashboard_recent_status'] = $this->config->get('dashboard_recent_status');
|
||||
$data['dashboard_recent_sort_order'] = $this->config->get('dashboard_recent_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/opencart/dashboard/recent_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/dashboard/recent');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/dashboard/recent')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('dashboard_recent', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function dashboard(): string {
|
||||
$this->load->language('extension/opencart/dashboard/recent');
|
||||
|
||||
// Last 5 Orders
|
||||
$data['orders'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'sort' => 'o.date_added',
|
||||
'order' => 'DESC',
|
||||
'start' => 0,
|
||||
'limit' => 5
|
||||
];
|
||||
|
||||
$this->load->model('sale/order');
|
||||
|
||||
$results = $this->model_sale_order->getOrders($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['orders'][] = [
|
||||
'order_id' => $result['order_id'],
|
||||
'customer' => $result['customer'],
|
||||
'status' => $result['order_status'],
|
||||
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
|
||||
'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
|
||||
'view' => $this->url->link('sale/order.info', 'user_token=' . $this->session->data['user_token'] . '&order_id=' . $result['order_id'])
|
||||
];
|
||||
}
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/dashboard/recent_info', $data);
|
||||
}
|
||||
}
|
119
extension/opencart/admin/controller/dashboard/sale.php
Normal file
119
extension/opencart/admin/controller/dashboard/sale.php
Normal file
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Dashboard;
|
||||
/**
|
||||
* Class Sale
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Dashboard
|
||||
*/
|
||||
class Sale extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/dashboard/sale');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/dashboard/sale', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/dashboard/sale.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=dashboard');
|
||||
|
||||
$data['dashboard_sale_width'] = $this->config->get('dashboard_sale_width');
|
||||
|
||||
$data['columns'] = [];
|
||||
|
||||
for ($i = 3; $i <= 12; $i++) {
|
||||
$data['columns'][] = $i;
|
||||
}
|
||||
|
||||
$data['dashboard_sale_status'] = $this->config->get('dashboard_sale_status');
|
||||
$data['dashboard_sale_sort_order'] = $this->config->get('dashboard_sale_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/opencart/dashboard/sale_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/dashboard/sale');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/dashboard/sale')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('dashboard_sale', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function dashboard(): string {
|
||||
$this->load->language('extension/opencart/dashboard/sale');
|
||||
|
||||
$this->load->model('extension/opencart/report/sale');
|
||||
|
||||
$today = $this->model_extension_opencart_report_sale->getTotalSales(['filter_date_added' => date('Y-m-d', strtotime('-1 day'))]);
|
||||
|
||||
$yesterday = $this->model_extension_opencart_report_sale->getTotalSales(['filter_date_added' => date('Y-m-d', strtotime('-2 day'))]);
|
||||
|
||||
$difference = $today - $yesterday;
|
||||
|
||||
if ($difference && (int)$today) {
|
||||
$data['percentage'] = round(($difference / $today) * 100);
|
||||
} else {
|
||||
$data['percentage'] = 0;
|
||||
}
|
||||
|
||||
$sale_total = $this->model_extension_opencart_report_sale->getTotalSales();
|
||||
|
||||
if ($sale_total > 1000000000000) {
|
||||
$data['total'] = round($sale_total / 1000000000000, 1) . 'T';
|
||||
} elseif ($sale_total > 1000000000) {
|
||||
$data['total'] = round($sale_total / 1000000000, 1) . 'B';
|
||||
} elseif ($sale_total > 1000000) {
|
||||
$data['total'] = round($sale_total / 1000000, 1) . 'M';
|
||||
} elseif ($sale_total > 1000) {
|
||||
$data['total'] = round($sale_total / 1000, 1) . 'K';
|
||||
} else {
|
||||
$data['total'] = round($sale_total);
|
||||
}
|
||||
|
||||
$data['sale'] = $this->url->link('sale/order', 'user_token=' . $this->session->data['user_token']);
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/dashboard/sale_info', $data);
|
||||
}
|
||||
}
|
0
extension/opencart/admin/controller/feed/index.html
Normal file
0
extension/opencart/admin/controller/feed/index.html
Normal file
199
extension/opencart/admin/controller/fraud/ip.php
Normal file
199
extension/opencart/admin/controller/fraud/ip.php
Normal file
@ -0,0 +1,199 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Fraud;
|
||||
/**
|
||||
* Class IP
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Fraud
|
||||
*/
|
||||
class Ip extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/fraud/ip');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=fraud')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/fraud/ip', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/fraud/ip.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=fraud');
|
||||
|
||||
$data['fraud_ip_order_status_id'] = $this->config->get('fraud_ip_order_status_id');
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['fraud_ip_status'] = $this->config->get('fraud_ip_status');
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$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/opencart/fraud/ip', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/fraud/ip');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/fraud/ip')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('fraud_ip', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function install(): void {
|
||||
if ($this->user->hasPermission('modify', 'extension/fraud')) {
|
||||
$this->load->model('extension/opencart/fraud/ip');
|
||||
|
||||
$this->model_extension_opencart_fraud_ip->install();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function uninstall(): void {
|
||||
if ($this->user->hasPermission('modify', 'extension/fraud')) {
|
||||
$this->load->model('extension/opencart/fraud/ip');
|
||||
|
||||
$this->model_extension_opencart_fraud_ip->uninstall();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function ip(): void {
|
||||
$this->load->language('extension/opencart/fraud/ip');
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$limit = 10;
|
||||
|
||||
$data['ips'] = [];
|
||||
|
||||
$this->load->model('extension/opencart/fraud/ip');
|
||||
$this->load->model('customer/customer');
|
||||
|
||||
$results = $this->model_extension_opencart_fraud_ip->getIps(($page - 1) * $limit, $limit);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['ips'][] = [
|
||||
'ip' => $result['ip'],
|
||||
'total' => $this->model_customer_customer->getTotalCustomersByIp($result['ip']),
|
||||
'date_added' => date('d/m/y', strtotime($result['date_added'])),
|
||||
'filter_ip' => $this->url->link('customer/customer', 'user_token=' . $this->session->data['user_token'] . '&filter_ip=' . $result['ip'])
|
||||
];
|
||||
}
|
||||
|
||||
$ip_total = $this->model_extension_opencart_fraud_ip->getTotalIps();
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $ip_total,
|
||||
'page' => $page,
|
||||
'limit' => $limit,
|
||||
'url' => $this->url->link('extension/opencart/fraud/ip.ip', 'user_token=' . $this->session->data['user_token'] . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($ip_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($ip_total - $limit)) ? $ip_total : ((($page - 1) * $limit) + $limit), $ip_total, ceil($ip_total / $limit));
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/fraud/ip_ip', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function addIp(): void {
|
||||
$this->load->language('extension/opencart/fraud/ip');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/fraud/ip')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (empty($this->request->post['ip'])) {
|
||||
$json['error'] = $this->language->get('error_required');
|
||||
} elseif (!filter_var($this->request->post['ip'], FILTER_VALIDATE_IP)) {
|
||||
$json['error'] = $this->language->get('error_invalid');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('extension/opencart/fraud/ip');
|
||||
|
||||
if (!$this->model_extension_opencart_fraud_ip->getTotalIpsByIp($this->request->post['ip'])) {
|
||||
$this->model_extension_opencart_fraud_ip->addIp($this->request->post['ip']);
|
||||
}
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function removeIp(): void {
|
||||
$this->load->language('extension/opencart/fraud/ip');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/fraud/ip')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('extension/opencart/fraud/ip');
|
||||
|
||||
$this->model_extension_opencart_fraud_ip->removeIp($this->request->post['ip']);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
69
extension/opencart/admin/controller/module/account.php
Normal file
69
extension/opencart/admin/controller/module/account.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class Account
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class Account extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/account');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/account', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/module/account.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
$data['module_account_status'] = $this->config->get('module_account_status');
|
||||
|
||||
$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/opencart/module/account', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/account');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/account')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('module_account', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
175
extension/opencart/admin/controller/module/banner.php
Normal file
175
extension/opencart/admin/controller/module/banner.php
Normal file
@ -0,0 +1,175 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class Banner
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class Banner extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/banner');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/banner', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
} else {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/banner', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id'])
|
||||
];
|
||||
}
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/banner.save', 'user_token=' . $this->session->data['user_token']);
|
||||
} else {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/banner.save', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id']);
|
||||
}
|
||||
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
$module_info = $this->model_setting_module->getModule($this->request->get['module_id']);
|
||||
}
|
||||
|
||||
if (isset($module_info['name'])) {
|
||||
$data['name'] = $module_info['name'];
|
||||
} else {
|
||||
$data['name'] = '';
|
||||
}
|
||||
|
||||
if (isset($module_info['banner_id'])) {
|
||||
$data['banner_id'] = $module_info['banner_id'];
|
||||
} else {
|
||||
$data['banner_id'] = '';
|
||||
}
|
||||
|
||||
$this->load->model('design/banner');
|
||||
|
||||
$data['banners'] = $this->model_design_banner->getBanners();
|
||||
|
||||
if (isset($module_info['effect'])) {
|
||||
$data['effect'] = $module_info['effect'];
|
||||
} else {
|
||||
$data['effect'] = '';
|
||||
}
|
||||
|
||||
if (isset($module_info['items'])) {
|
||||
$data['items'] = $module_info['items'];
|
||||
} else {
|
||||
$data['items'] = 4;
|
||||
}
|
||||
|
||||
if (isset($module_info['controls'])) {
|
||||
$data['controls'] = $module_info['controls'];
|
||||
} else {
|
||||
$data['controls'] = '';
|
||||
}
|
||||
|
||||
if (isset($module_info['indicators'])) {
|
||||
$data['indicators'] = $module_info['indicators'];
|
||||
} else {
|
||||
$data['indicators'] = '';
|
||||
}
|
||||
|
||||
if (isset($module_info['interval'])) {
|
||||
$data['interval'] = $module_info['interval'];
|
||||
} else {
|
||||
$data['interval'] = 5000;
|
||||
}
|
||||
|
||||
if (isset($module_info['width'])) {
|
||||
$data['width'] = $module_info['width'];
|
||||
} else {
|
||||
$data['width'] = '';
|
||||
}
|
||||
|
||||
if (isset($module_info['height'])) {
|
||||
$data['height'] = $module_info['height'];
|
||||
} else {
|
||||
$data['height'] = '';
|
||||
}
|
||||
|
||||
if (isset($module_info['status'])) {
|
||||
$data['status'] = $module_info['status'];
|
||||
} else {
|
||||
$data['status'] = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$data['module_id'] = (int)$this->request->get['module_id'];
|
||||
} else {
|
||||
$data['module_id'] = 0;
|
||||
}
|
||||
|
||||
$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/opencart/module/banner', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/banner');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/banner')) {
|
||||
$json['error']['warning'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if ((oc_strlen($this->request->post['name']) < 3) || (oc_strlen($this->request->post['name']) > 64)) {
|
||||
$json['error']['name'] = $this->language->get('error_name');
|
||||
}
|
||||
|
||||
if (!$this->request->post['interval']) {
|
||||
$json['error']['interval'] = $this->language->get('error_interval');
|
||||
}
|
||||
|
||||
if (!$this->request->post['width']) {
|
||||
$json['error']['width'] = $this->language->get('error_width');
|
||||
}
|
||||
|
||||
if (!$this->request->post['height']) {
|
||||
$json['error']['height'] = $this->language->get('error_height');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
if (!$this->request->post['module_id']) {
|
||||
$json['module_id'] = $this->model_setting_module->addModule('opencart.banner', $this->request->post);
|
||||
} else {
|
||||
$this->model_setting_module->editModule($this->request->post['module_id'], $this->request->post);
|
||||
}
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
290
extension/opencart/admin/controller/module/bestseller.php
Normal file
290
extension/opencart/admin/controller/module/bestseller.php
Normal file
@ -0,0 +1,290 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class Best Seller
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class BestSeller extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/bestseller');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/bestseller', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
} else {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/bestseller', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id'])
|
||||
];
|
||||
}
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/bestseller.save', 'user_token=' . $this->session->data['user_token']);
|
||||
} else {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/bestseller.save', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id']);
|
||||
}
|
||||
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
$module_info = $this->model_setting_module->getModule($this->request->get['module_id']);
|
||||
}
|
||||
|
||||
if (isset($module_info['name'])) {
|
||||
$data['name'] = $module_info['name'];
|
||||
} else {
|
||||
$data['name'] = '';
|
||||
}
|
||||
|
||||
if (isset($module_info['axis'])) {
|
||||
$data['axis'] = $module_info['axis'];
|
||||
} else {
|
||||
$data['axis'] ='';
|
||||
}
|
||||
|
||||
if (isset($module_info['limit'])) {
|
||||
$data['limit'] = $module_info['limit'];
|
||||
} else {
|
||||
$data['limit'] = 5;
|
||||
}
|
||||
|
||||
if (isset($module_info['width'])) {
|
||||
$data['width'] = $module_info['width'];
|
||||
} else {
|
||||
$data['width'] = 200;
|
||||
}
|
||||
|
||||
if (isset($module_info['height'])) {
|
||||
$data['height'] = $module_info['height'];
|
||||
} else {
|
||||
$data['height'] = 200;
|
||||
}
|
||||
|
||||
if (isset($module_info['status'])) {
|
||||
$data['status'] = $module_info['status'];
|
||||
} else {
|
||||
$data['status'] = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$data['module_id'] = (int)$this->request->get['module_id'];
|
||||
} else {
|
||||
$data['module_id'] = 0;
|
||||
}
|
||||
|
||||
$data['report'] = $this->getReport();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$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/opencart/module/bestseller', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/bestseller');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/bestseller')) {
|
||||
$json['error']['warning'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if ((oc_strlen($this->request->post['name']) < 3) || (oc_strlen($this->request->post['name']) > 64)) {
|
||||
$json['error']['name'] = $this->language->get('error_name');
|
||||
}
|
||||
|
||||
if (!$this->request->post['width']) {
|
||||
$json['error']['width'] = $this->language->get('error_width');
|
||||
}
|
||||
|
||||
if (!$this->request->post['height']) {
|
||||
$json['error']['height'] = $this->language->get('error_height');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
if (!$this->request->post['module_id']) {
|
||||
$json['module_id'] = $this->model_setting_module->addModule('opencart.bestseller', $this->request->post);
|
||||
} else {
|
||||
$this->model_setting_module->editModule($this->request->post['module_id'], $this->request->post);
|
||||
}
|
||||
|
||||
$this->cache->delete('product');
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function install(): void {
|
||||
if ($this->user->hasPermission('modify', 'extension/opencart/module/bestseller')) {
|
||||
$this->load->model('extension/opencart/module/bestseller');
|
||||
|
||||
$this->model_extension_opencart_module_bestseller->install();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function uninstall(): void {
|
||||
if ($this->user->hasPermission('modify', 'extension/opencart/module/bestseller')) {
|
||||
$this->load->model('extension/opencart/module/bestseller');
|
||||
|
||||
$this->model_extension_opencart_module_bestseller->uninstall();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/module/bestseller');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['page']) && $this->request->get['route'] == 'extension/opencart/module/bestseller.report') {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$limit = 10;
|
||||
|
||||
$data['reports'] = [];
|
||||
|
||||
$this->load->model('extension/opencart/module/bestseller');
|
||||
$this->load->model('catalog/product');
|
||||
|
||||
$results = $this->model_extension_opencart_module_bestseller->getReports(($page - 1) * $limit, $limit);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$product_info = $this->model_catalog_product->getProduct($result['product_id']);
|
||||
|
||||
if ($product_info) {
|
||||
$product = $product_info['name'];
|
||||
} else {
|
||||
$product = '';
|
||||
}
|
||||
|
||||
$data['reports'][] = [
|
||||
'product' => $product,
|
||||
'total' => $result['total'],
|
||||
'edit' => $this->url->link('catalog/product.edit', 'user_token=' . $this->session->data['user_token'] . '&product_id=' . $result['product_id'])
|
||||
];
|
||||
}
|
||||
|
||||
$report_total = $this->model_extension_opencart_module_bestseller->getTotalReports();
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $report_total,
|
||||
'page' => $page,
|
||||
'limit' => $limit,
|
||||
'url' => $this->url->link('extension/opencart/module/bestseller.report', 'user_token=' . $this->session->data['user_token'] . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($report_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($report_total - $limit)) ? $report_total : ((($page - 1) * $limit) + $limit), $report_total, ceil($report_total / $limit));
|
||||
|
||||
return $this->load->view('extension/opencart/module/bestseller_report', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function sync(): void {
|
||||
$this->load->language('extension/opencart/module/bestseller');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/bestseller')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('extension/opencart/module/bestseller');
|
||||
$this->load->model('catalog/product');
|
||||
$this->load->model('sale/order');
|
||||
|
||||
$total = $this->model_catalog_product->getTotalProducts();
|
||||
$limit = 10;
|
||||
|
||||
$start = ($page - 1) * $limit;
|
||||
$end = $start > ($total - $limit) ? $total : ($start + $limit);
|
||||
|
||||
$product_data = [
|
||||
'start' => ($page - 1) * $limit,
|
||||
'limit' => $limit
|
||||
];
|
||||
|
||||
$results = $this->model_catalog_product->getProducts($product_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$product_total = $this->model_sale_order->getTotalProductsByProductId($result['product_id']);
|
||||
|
||||
if ($product_total) {
|
||||
$this->model_extension_opencart_module_bestseller->editTotal($result['product_id'], $product_total);
|
||||
} else {
|
||||
$this->model_extension_opencart_module_bestseller->delete($result['product_id']);
|
||||
}
|
||||
}
|
||||
|
||||
if ($end < $total) {
|
||||
$json['text'] = sprintf($this->language->get('text_next'), $end, $total);
|
||||
|
||||
$json['next'] = $this->url->link('extension/opencart/module/bestseller.sync', 'user_token=' . $this->session->data['user_token'] . '&page=' . ($page + 1), true);
|
||||
} else {
|
||||
$json['success'] = sprintf($this->language->get('text_next'), $end, $total);
|
||||
|
||||
$json['next'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
69
extension/opencart/admin/controller/module/category.php
Normal file
69
extension/opencart/admin/controller/module/category.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class Category
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class Category extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/category');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/category', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/module/category.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
$data['module_category_status'] = $this->config->get('module_category_status');
|
||||
|
||||
$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/opencart/module/category', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/category');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/category')) {
|
||||
$json['error']['warning'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('module_category', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
160
extension/opencart/admin/controller/module/featured.php
Normal file
160
extension/opencart/admin/controller/module/featured.php
Normal file
@ -0,0 +1,160 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class Featured
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class Featured extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/featured');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/featured', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
} else {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/featured', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id'])
|
||||
];
|
||||
}
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/featured.save', 'user_token=' . $this->session->data['user_token']);
|
||||
} else {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/featured.save', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id']);
|
||||
}
|
||||
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
$module_info = $this->model_setting_module->getModule($this->request->get['module_id']);
|
||||
}
|
||||
|
||||
if (isset($module_info['name'])) {
|
||||
$data['name'] = $module_info['name'];
|
||||
} else {
|
||||
$data['name'] = '';
|
||||
}
|
||||
|
||||
$this->load->model('catalog/product');
|
||||
|
||||
$data['products'] = [];
|
||||
|
||||
if (!empty($module_info['product'])) {
|
||||
$products = $module_info['product'];
|
||||
} else {
|
||||
$products = [];
|
||||
}
|
||||
|
||||
foreach ($products as $product_id) {
|
||||
$product_info = $this->model_catalog_product->getProduct($product_id);
|
||||
|
||||
if ($product_info) {
|
||||
$data['products'][] = [
|
||||
'product_id' => $product_info['product_id'],
|
||||
'name' => $product_info['name']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($module_info['axis'])) {
|
||||
$data['axis'] = $module_info['axis'];
|
||||
} else {
|
||||
$data['axis'] ='';
|
||||
}
|
||||
|
||||
if (isset($module_info['width'])) {
|
||||
$data['width'] = $module_info['width'];
|
||||
} else {
|
||||
$data['width'] = 200;
|
||||
}
|
||||
|
||||
if (isset($module_info['height'])) {
|
||||
$data['height'] = $module_info['height'];
|
||||
} else {
|
||||
$data['height'] = 200;
|
||||
}
|
||||
|
||||
if (isset($module_info['status'])) {
|
||||
$data['status'] = $module_info['status'];
|
||||
} else {
|
||||
$data['status'] = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$data['module_id'] = (int)$this->request->get['module_id'];
|
||||
} else {
|
||||
$data['module_id'] = 0;
|
||||
}
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$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/opencart/module/featured', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/featured');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/featured')) {
|
||||
$json['error']['warning'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if ((oc_strlen($this->request->post['name']) < 3) || (oc_strlen($this->request->post['name']) > 64)) {
|
||||
$json['error']['name'] = $this->language->get('error_name');
|
||||
}
|
||||
|
||||
if (!$this->request->post['width']) {
|
||||
$json['error']['width'] = $this->language->get('error_width');
|
||||
}
|
||||
|
||||
if (!$this->request->post['height']) {
|
||||
$json['error']['height'] = $this->language->get('error_height');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
if (!$this->request->post['module_id']) {
|
||||
$json['module_id'] = $this->model_setting_module->addModule('opencart.featured', $this->request->post);
|
||||
} else {
|
||||
$this->model_setting_module->editModule($this->request->post['module_id'], $this->request->post);
|
||||
}
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
69
extension/opencart/admin/controller/module/filter.php
Normal file
69
extension/opencart/admin/controller/module/filter.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class Filter
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class Filter extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/filter');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/filter', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/module/filter.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
$data['module_filter_status'] = $this->config->get('module_filter_status');
|
||||
|
||||
$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/opencart/module/filter', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/filter');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/filter')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('module_filter', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
124
extension/opencart/admin/controller/module/html.php
Normal file
124
extension/opencart/admin/controller/module/html.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class HTML
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class HTML extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/html');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$this->document->addScript('view/javascript/ckeditor/ckeditor.js');
|
||||
$this->document->addScript('view/javascript/ckeditor/adapters/jquery.js');
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/html', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
} else {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/html', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id'])
|
||||
];
|
||||
}
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/html.save', 'user_token=' . $this->session->data['user_token']);
|
||||
} else {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/html.save', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id']);
|
||||
}
|
||||
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
if (isset($this->request->get['module_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
$module_info = $this->model_setting_module->getModule($this->request->get['module_id']);
|
||||
}
|
||||
|
||||
if (isset($module_info['name'])) {
|
||||
$data['name'] = $module_info['name'];
|
||||
} else {
|
||||
$data['name'] = '';
|
||||
}
|
||||
|
||||
if (isset($module_info['module_description'])) {
|
||||
$data['module_description'] = $module_info['module_description'];
|
||||
} else {
|
||||
$data['module_description'] = [];
|
||||
}
|
||||
|
||||
$this->load->model('localisation/language');
|
||||
|
||||
$data['languages'] = $this->model_localisation_language->getLanguages();
|
||||
|
||||
if (isset($module_info['status'])) {
|
||||
$data['status'] = $module_info['status'];
|
||||
} else {
|
||||
$data['status'] = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$data['module_id'] = (int)$this->request->get['module_id'];
|
||||
} else {
|
||||
$data['module_id'] = 0;
|
||||
}
|
||||
|
||||
$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/opencart/module/html', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/html');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/html')) {
|
||||
$json['error']['warning'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if ((oc_strlen($this->request->post['name']) < 3) || (oc_strlen($this->request->post['name']) > 64)) {
|
||||
$json['error']['name'] = $this->language->get('error_name');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
if (!$this->request->post['module_id']) {
|
||||
$json['module_id'] = $this->model_setting_module->addModule('opencart.html', $this->request->post);
|
||||
} else {
|
||||
$this->model_setting_module->editModule($this->request->post['module_id'], $this->request->post);
|
||||
}
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
69
extension/opencart/admin/controller/module/information.php
Normal file
69
extension/opencart/admin/controller/module/information.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class Information
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class Information extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/information');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/information', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/module/information.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
$data['module_information_status'] = $this->config->get('module_information_status');
|
||||
|
||||
$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/opencart/module/information', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/information');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/information')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('module_information', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
145
extension/opencart/admin/controller/module/latest.php
Normal file
145
extension/opencart/admin/controller/module/latest.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class Latest
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class Latest extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/latest');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/latest', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
} else {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/latest', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id'])
|
||||
];
|
||||
}
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/latest.save', 'user_token=' . $this->session->data['user_token']);
|
||||
} else {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/latest.save', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id']);
|
||||
}
|
||||
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
$module_info = $this->model_setting_module->getModule($this->request->get['module_id']);
|
||||
}
|
||||
|
||||
if (isset($module_info['name'])) {
|
||||
$data['name'] = $module_info['name'];
|
||||
} else {
|
||||
$data['name'] = '';
|
||||
}
|
||||
|
||||
if (isset($module_info['axis'])) {
|
||||
$data['axis'] = $module_info['axis'];
|
||||
} else {
|
||||
$data['axis'] ='';
|
||||
}
|
||||
|
||||
if (isset($module_info['limit'])) {
|
||||
$data['limit'] = $module_info['limit'];
|
||||
} else {
|
||||
$data['limit'] = 5;
|
||||
}
|
||||
|
||||
if (isset($module_info['width'])) {
|
||||
$data['width'] = $module_info['width'];
|
||||
} else {
|
||||
$data['width'] = 200;
|
||||
}
|
||||
|
||||
if (isset($module_info['height'])) {
|
||||
$data['height'] = $module_info['height'];
|
||||
} else {
|
||||
$data['height'] = 200;
|
||||
}
|
||||
|
||||
if (isset($module_info['status'])) {
|
||||
$data['status'] = $module_info['status'];
|
||||
} else {
|
||||
$data['status'] = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$data['module_id'] = (int)$this->request->get['module_id'];
|
||||
} else {
|
||||
$data['module_id'] = 0;
|
||||
}
|
||||
|
||||
$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/opencart/module/latest', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/latest');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/latest')) {
|
||||
$json['error']['warning'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if ((oc_strlen($this->request->post['name']) < 3) || (oc_strlen($this->request->post['name']) > 64)) {
|
||||
$json['error']['name'] = $this->language->get('error_name');
|
||||
}
|
||||
|
||||
if (!$this->request->post['width']) {
|
||||
$json['error']['width'] = $this->language->get('error_width');
|
||||
}
|
||||
|
||||
if (!$this->request->post['height']) {
|
||||
$json['error']['height'] = $this->language->get('error_height');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
if (!$this->request->post['module_id']) {
|
||||
$json['module_id'] = $this->model_setting_module->addModule('opencart.latest', $this->request->post);
|
||||
} else {
|
||||
$this->model_setting_module->editModule($this->request->post['module_id'], $this->request->post);
|
||||
}
|
||||
|
||||
$this->cache->delete('product');
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
145
extension/opencart/admin/controller/module/special.php
Normal file
145
extension/opencart/admin/controller/module/special.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class Special
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class Special extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/special');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/special', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
} else {
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/special', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id'])
|
||||
];
|
||||
}
|
||||
|
||||
if (!isset($this->request->get['module_id'])) {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/special.save', 'user_token=' . $this->session->data['user_token']);
|
||||
} else {
|
||||
$data['save'] = $this->url->link('extension/opencart/module/special.save', 'user_token=' . $this->session->data['user_token'] . '&module_id=' . $this->request->get['module_id']);
|
||||
}
|
||||
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
$module_info = $this->model_setting_module->getModule($this->request->get['module_id']);
|
||||
}
|
||||
|
||||
if (isset($module_info['name'])) {
|
||||
$data['name'] = $module_info['name'];
|
||||
} else {
|
||||
$data['name'] = '';
|
||||
}
|
||||
|
||||
if (isset($module_info['axis'])) {
|
||||
$data['axis'] = $module_info['axis'];
|
||||
} else {
|
||||
$data['axis'] ='';
|
||||
}
|
||||
|
||||
if (isset($module_info['limit'])) {
|
||||
$data['limit'] = $module_info['limit'];
|
||||
} else {
|
||||
$data['limit'] = 5;
|
||||
}
|
||||
|
||||
if (isset($module_info['width'])) {
|
||||
$data['width'] = $module_info['width'];
|
||||
} else {
|
||||
$data['width'] = 200;
|
||||
}
|
||||
|
||||
if (isset($module_info['height'])) {
|
||||
$data['height'] = $module_info['height'];
|
||||
} else {
|
||||
$data['height'] = 200;
|
||||
}
|
||||
|
||||
if (isset($module_info['status'])) {
|
||||
$data['status'] = $module_info['status'];
|
||||
} else {
|
||||
$data['status'] = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['module_id'])) {
|
||||
$data['module_id'] = (int)$this->request->get['module_id'];
|
||||
} else {
|
||||
$data['module_id'] = 0;
|
||||
}
|
||||
|
||||
$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/opencart/module/special', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/special');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/special')) {
|
||||
$json['error']['warning'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if ((oc_strlen($this->request->post['name']) < 3) || (oc_strlen($this->request->post['name']) > 64)) {
|
||||
$json['error']['name'] = $this->language->get('error_name');
|
||||
}
|
||||
|
||||
if (!$this->request->post['width']) {
|
||||
$json['error']['width'] = $this->language->get('error_width');
|
||||
}
|
||||
|
||||
if (!$this->request->post['height']) {
|
||||
$json['error']['height'] = $this->language->get('error_height');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/module');
|
||||
|
||||
if (!$this->request->post['module_id']) {
|
||||
$json['module_id'] = $this->model_setting_module->addModule('opencart.special', $this->request->post);
|
||||
} else {
|
||||
$this->model_setting_module->editModule($this->request->post['module_id'], $this->request->post);
|
||||
}
|
||||
|
||||
$this->cache->delete('product');
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
70
extension/opencart/admin/controller/module/store.php
Normal file
70
extension/opencart/admin/controller/module/store.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Module;
|
||||
/**
|
||||
* Class Store
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Module
|
||||
*/
|
||||
class Store extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/module/store');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/module/store', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/module/store.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=module');
|
||||
|
||||
$data['module_store_admin'] = $this->config->get('module_store_admin');
|
||||
$data['module_store_status'] = $this->config->get('module_store_status');
|
||||
|
||||
$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/opencart/module/store', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/module/store');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/module/store')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('module_store', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
104
extension/opencart/admin/controller/payment/bank_transfer.php
Normal file
104
extension/opencart/admin/controller/payment/bank_transfer.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Payment;
|
||||
/**
|
||||
* Class Bank Transfer
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Payment
|
||||
*/
|
||||
class BankTransfer extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/payment/bank_transfer');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/payment/bank_transfer', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/payment/bank_transfer.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment');
|
||||
|
||||
$this->load->model('localisation/language');
|
||||
|
||||
$data['payment_bank_transfer_bank'] = [];
|
||||
|
||||
$languages = $this->model_localisation_language->getLanguages();
|
||||
|
||||
foreach ($languages as $language) {
|
||||
$data['payment_bank_transfer_bank'][$language['language_id']] = $this->config->get('payment_bank_transfer_bank_' . $language['language_id']);
|
||||
}
|
||||
|
||||
$data['languages'] = $languages;
|
||||
|
||||
$data['payment_bank_transfer_order_status_id'] = $this->config->get('payment_bank_transfer_order_status_id');
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['payment_bank_transfer_geo_zone_id'] = $this->config->get('payment_bank_transfer_geo_zone_id');
|
||||
|
||||
$this->load->model('localisation/geo_zone');
|
||||
|
||||
$data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones();
|
||||
|
||||
$data['payment_bank_transfer_status'] = $this->config->get('payment_bank_transfer_status');
|
||||
$data['payment_bank_transfer_sort_order'] = $this->config->get('payment_bank_transfer_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/opencart/payment/bank_transfer', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/payment/bank_transfer');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/payment/bank_transfer')) {
|
||||
$json['error']['warning'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
$this->load->model('localisation/language');
|
||||
|
||||
$languages = $this->model_localisation_language->getLanguages();
|
||||
|
||||
foreach ($languages as $language) {
|
||||
if (empty($this->request->post['payment_bank_transfer_bank_' . $language['language_id']])) {
|
||||
$json['error']['bank_' . $language['language_id']] = $this->language->get('error_bank');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('payment_bank_transfer', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
87
extension/opencart/admin/controller/payment/cheque.php
Normal file
87
extension/opencart/admin/controller/payment/cheque.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Payment;
|
||||
/**
|
||||
* Class Cheque
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Payment
|
||||
*/
|
||||
class Cheque extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/payment/cheque');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/payment/cheque', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/payment/cheque.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment');
|
||||
|
||||
$data['payment_cheque_payable'] = $this->config->get('payment_cheque_payable');
|
||||
$data['payment_cheque_order_status_id'] = $this->config->get('payment_cheque_order_status_id');
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['payment_cheque_geo_zone_id'] = $this->config->get('payment_cheque_geo_zone_id');
|
||||
|
||||
$this->load->model('localisation/geo_zone');
|
||||
|
||||
$data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones();
|
||||
|
||||
$data['payment_cheque_status'] = $this->config->get('payment_cheque_status');
|
||||
$data['payment_cheque_sort_order'] = $this->config->get('payment_cheque_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/opencart/payment/cheque', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/payment/cheque');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/payment/cheque')) {
|
||||
$json['error']['warning'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$this->request->post['payment_cheque_payable']) {
|
||||
$json['error']['payable'] = $this->language->get('error_payable');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('payment_cheque', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
82
extension/opencart/admin/controller/payment/cod.php
Normal file
82
extension/opencart/admin/controller/payment/cod.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Payment;
|
||||
/**
|
||||
* Class Cod
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Payment
|
||||
*/
|
||||
class Cod extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/payment/cod');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/payment/cod', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/payment/cod.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment');
|
||||
|
||||
$data['payment_cod_order_status_id'] = $this->config->get('payment_cod_order_status_id');
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['payment_cod_geo_zone_id'] = $this->config->get('payment_cod_geo_zone_id');
|
||||
|
||||
$this->load->model('localisation/geo_zone');
|
||||
|
||||
$data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones();
|
||||
|
||||
$data['payment_cod_status'] = $this->config->get('payment_cod_status');
|
||||
$data['payment_cod_sort_order'] = $this->config->get('payment_cod_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/opencart/payment/cod', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/payment/cod');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/payment/cod')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('payment_cod', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Payment;
|
||||
/**
|
||||
* Class Free Checkout
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Payment
|
||||
*/
|
||||
class FreeCheckout extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/payment/free_checkout');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/payment/free_checkout', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/payment/free_checkout.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment');
|
||||
|
||||
$data['payment_free_checkout_order_status_id'] = $this->config->get('payment_free_checkout_order_status_id');
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['payment_free_checkout_status'] = $this->config->get('payment_free_checkout_status');
|
||||
$data['payment_free_checkout_sort_order'] = $this->config->get('payment_free_checkout_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/opencart/payment/free_checkout', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/payment/free_checkout');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/payment/free_checkout')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('payment_free_checkout', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
198
extension/opencart/admin/controller/report/customer.php
Normal file
198
extension/opencart/admin/controller/report/customer.php
Normal file
@ -0,0 +1,198 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class Customer
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class Customer extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/customer');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/customer', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/customer.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_customer_status'] = $this->config->get('report_customer_status');
|
||||
$data['report_customer_sort_order'] = $this->config->get('report_customer_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/opencart/report/customer_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/customer');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/customer')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_customer', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/customer');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$data['groups'] = [];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_year'),
|
||||
'value' => 'year',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_month'),
|
||||
'value' => 'month',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_week'),
|
||||
'value' => 'week',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_day'),
|
||||
'value' => 'day',
|
||||
];
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/customer', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/customer');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_group'])) {
|
||||
$filter_group = $this->request->get['filter_group'];
|
||||
} else {
|
||||
$filter_group = 'week';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['customers'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_group' => $filter_group,
|
||||
'start' => ($page - 1) * 20,
|
||||
'limit' => 20
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/customer');
|
||||
|
||||
$customer_total = $this->model_extension_opencart_report_customer->getTotalCustomers($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer->getCustomers($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['customers'][] = [
|
||||
'date_start' => date($this->language->get('date_format_short'), strtotime($result['date_start'])),
|
||||
'date_end' => date($this->language->get('date_format_short'), strtotime($result['date_end'])),
|
||||
'total' => $result['total'],
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_group'])) {
|
||||
$url .= '&filter_group=' . $this->request->get['filter_group'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $customer_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/customer.report', 'user_token=' . $this->session->data['user_token'] . '&code=customer' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($customer_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($customer_total - $this->config->get('config_pagination'))) ? $customer_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $customer_total, ceil($customer_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_group'] = $filter_group;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/customer_list', $data);
|
||||
}
|
||||
}
|
200
extension/opencart/admin/controller/report/customer_activity.php
Normal file
200
extension/opencart/admin/controller/report/customer_activity.php
Normal file
@ -0,0 +1,200 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class Customer Activity
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class CustomerActivity extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/customer_activity');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/customer_activity', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/customer_activity.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_customer_activity_status'] = $this->config->get('report_customer_activity_status');
|
||||
$data['report_customer_activity_sort_order'] = $this->config->get('report_customer_activity_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/opencart/report/customer_activity_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/customer_activity');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/customer_activity')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_customer_activity', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/customer_activity');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/customer_activity', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/customer_activity');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$filter_customer = $this->request->get['filter_customer'];
|
||||
} else {
|
||||
$filter_customer = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_ip'])) {
|
||||
$filter_ip = $this->request->get['filter_ip'];
|
||||
} else {
|
||||
$filter_ip = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['activities'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_customer' => $filter_customer,
|
||||
'filter_ip' => $filter_ip,
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'start' => ($page - 1) * 20,
|
||||
'limit' => 20
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/customer');
|
||||
|
||||
$activity_total = $this->model_extension_opencart_report_customer->getTotalCustomerActivities($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer->getCustomerActivities($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$comment = vsprintf($this->language->get('text_activity_' . $result['key']), json_decode($result['data'], true));
|
||||
|
||||
$find = [
|
||||
'customer_id=',
|
||||
'order_id='
|
||||
];
|
||||
|
||||
$replace = [
|
||||
$this->url->link('customer/customer.form', 'user_token=' . $this->session->data['user_token'] . '&customer_id='),
|
||||
$this->url->link('sale/order.info', 'user_token=' . $this->session->data['user_token'] . '&order_id=')
|
||||
];
|
||||
|
||||
$data['activities'][] = [
|
||||
'comment' => str_replace($find, $replace, $comment),
|
||||
'ip' => $result['ip'],
|
||||
'date_added' => date($this->language->get('datetime_format'), strtotime($result['date_added']))
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$url .= '&filter_customer=' . urlencode($this->request->get['filter_customer']);
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_ip'])) {
|
||||
$url .= '&filter_ip=' . $this->request->get['filter_ip'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $activity_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/customer_activity.report', 'user_token=' . $this->session->data['user_token'] . '&code=customer_activity' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($activity_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($activity_total - $this->config->get('config_pagination'))) ? $activity_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $activity_total, ceil($activity_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_customer'] = $filter_customer;
|
||||
$data['filter_ip'] = $filter_ip;
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/customer_activity_list', $data);
|
||||
}
|
||||
}
|
197
extension/opencart/admin/controller/report/customer_order.php
Normal file
197
extension/opencart/admin/controller/report/customer_order.php
Normal file
@ -0,0 +1,197 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class Customer Order
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class CustomerOrder extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/customer_order');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/opencart/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/customer_order', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/customer_order.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_customer_order_status'] = $this->config->get('report_customer_order_status');
|
||||
$data['report_customer_order_sort_order'] = $this->config->get('report_customer_order_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/opencart/report/customer_order_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/customer_order');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/customer_order')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_customer_order', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/customer_order');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/customer_order', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/customer_order');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$filter_customer = $this->request->get['filter_customer'];
|
||||
} else {
|
||||
$filter_customer = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$filter_order_status_id = (int)$this->request->get['filter_order_status_id'];
|
||||
} else {
|
||||
$filter_order_status_id = 0;
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['customers'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_customer' => $filter_customer,
|
||||
'filter_order_status_id' => $filter_order_status_id,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/customer');
|
||||
|
||||
$customer_total = $this->model_extension_opencart_report_customer->getTotalOrders($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer->getOrders($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['customers'][] = [
|
||||
'customer' => $result['customer'],
|
||||
'email' => $result['email'],
|
||||
'customer_group' => $result['customer_group'],
|
||||
'status' => ($result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled')),
|
||||
'orders' => $result['orders'],
|
||||
'products' => $result['products'],
|
||||
'total' => $this->currency->format($result['total'], $this->config->get('config_currency')),
|
||||
'edit' => $this->url->link('customer/customer.form', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id'])
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$url .= '&filter_customer=' . urlencode($this->request->get['filter_customer']);
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$url .= '&filter_order_status_id=' . $this->request->get['filter_order_status_id'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $customer_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/customer_order.report', 'user_token=' . $this->session->data['user_token'] . '&code=customer_order' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($customer_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($customer_total - $this->config->get('config_pagination'))) ? $customer_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $customer_total, ceil($customer_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_customer'] = $filter_customer;
|
||||
$data['filter_order_status_id'] = $filter_order_status_id;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/customer_order_list', $data);
|
||||
}
|
||||
}
|
181
extension/opencart/admin/controller/report/customer_reward.php
Normal file
181
extension/opencart/admin/controller/report/customer_reward.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class Customer Reward
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class CustomerReward extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/customer_reward');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/customer_reward', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/customer_reward.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_customer_reward_status'] = $this->config->get('report_customer_reward_status');
|
||||
$data['report_customer_reward_sort_order'] = $this->config->get('report_customer_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/opencart/report/customer_reward_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/customer_reward');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/customer_reward')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_customer_reward', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/customer_reward');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/customer_reward', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/customer_reward');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$filter_customer = $this->request->get['filter_customer'];
|
||||
} else {
|
||||
$filter_customer = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['customers'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_customer' => $filter_customer,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/customer');
|
||||
|
||||
$customer_total = $this->model_extension_opencart_report_customer->getTotalRewardPoints($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer->getRewardPoints($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['customers'][] = [
|
||||
'customer' => $result['customer'],
|
||||
'email' => $result['email'],
|
||||
'customer_group' => $result['customer_group'],
|
||||
'status' => ($result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled')),
|
||||
'points' => $result['points'],
|
||||
'orders' => $result['orders'],
|
||||
'total' => $this->currency->format((float)$result['total'], $this->config->get('config_currency')),
|
||||
'edit' => $this->url->link('customer/customer.form', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id'])
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$url .= '&filter_customer=' . urlencode($this->request->get['filter_customer']);
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $customer_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/customer_reward.report', 'user_token=' . $this->session->data['user_token'] . '&code=customer_reward' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($customer_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($customer_total - $this->config->get('config_pagination'))) ? $customer_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $customer_total, ceil($customer_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_customer'] = $filter_customer;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/customer_reward_list', $data);
|
||||
}
|
||||
}
|
218
extension/opencart/admin/controller/report/customer_search.php
Normal file
218
extension/opencart/admin/controller/report/customer_search.php
Normal file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class CustomerSearch
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class CustomerSearch extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/customer_search');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/customer_search', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/customer_search.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_customer_search_status'] = $this->config->get('report_customer_search_status');
|
||||
$data['report_customer_search_sort_order'] = $this->config->get('report_customer_search_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/opencart/report/customer_search_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/customer_search');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/customer_search')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_customer_search', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/customer_search');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/customer_search', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/customer_search');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_keyword'])) {
|
||||
$filter_keyword = $this->request->get['filter_keyword'];
|
||||
} else {
|
||||
$filter_keyword = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$filter_customer = $this->request->get['filter_customer'];
|
||||
} else {
|
||||
$filter_customer = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_ip'])) {
|
||||
$filter_ip = $this->request->get['filter_ip'];
|
||||
} else {
|
||||
$filter_ip = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['searches'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_keyword' => $filter_keyword,
|
||||
'filter_customer' => $filter_customer,
|
||||
'filter_ip' => $filter_ip,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/customer');
|
||||
$this->load->model('catalog/category');
|
||||
|
||||
$search_total = $this->model_extension_opencart_report_customer->getTotalCustomerSearches($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer->getCustomerSearches($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$category_info = $this->model_catalog_category->getCategory($result['category_id']);
|
||||
|
||||
if ($category_info) {
|
||||
$category = ($category_info['path']) ? $category_info['path'] . ' > ' . $category_info['name'] : $category_info['name'];
|
||||
} else {
|
||||
$category = '';
|
||||
}
|
||||
|
||||
if ($result['customer_id'] > 0) {
|
||||
$customer = sprintf($this->language->get('text_customer'), $this->url->link('customer/customer.form', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id']), $result['customer']);
|
||||
} else {
|
||||
$customer = $this->language->get('text_guest');
|
||||
}
|
||||
|
||||
$data['searches'][] = [
|
||||
'keyword' => $result['keyword'],
|
||||
'products' => $result['products'],
|
||||
'category' => $category,
|
||||
'customer' => $customer,
|
||||
'ip' => $result['ip'],
|
||||
'date_added' => date($this->language->get('datetime_format'), strtotime($result['date_added']))
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_keyword'])) {
|
||||
$url .= '&filter_keyword=' . urlencode($this->request->get['filter_keyword']);
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$url .= '&filter_customer=' . urlencode($this->request->get['filter_customer']);
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_ip'])) {
|
||||
$url .= '&filter_ip=' . $this->request->get['filter_ip'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $search_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/customer_search.report', 'user_token=' . $this->session->data['user_token'] . '&code=customer_search' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($search_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($search_total - $this->config->get('config_pagination'))) ? $search_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $search_total, ceil($search_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_keyword'] = $filter_keyword;
|
||||
$data['filter_customer'] = $filter_customer;
|
||||
$data['filter_ip'] = $filter_ip;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/customer_search_list', $data);
|
||||
}
|
||||
}
|
@ -0,0 +1,179 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class CustomerSubscription
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class CustomerSubscription extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/customer_subscription');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/customer_subscription', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/customer_subscription.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_customer_subscription_status'] = $this->config->get('report_customer_subscription_status');
|
||||
$data['report_customer_subscription_sort_order'] = $this->config->get('report_customer_subscription_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/opencart/report/customer_subscription_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/customer_subscription');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/customer_subscription')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_customer_subscription', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/customer_subscription');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/customer_subscription', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/customer_subscription');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$filter_customer = $this->request->get['filter_customer'];
|
||||
} else {
|
||||
$filter_customer = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['subscriptions'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_customer' => $filter_customer,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/customer_subscription');
|
||||
|
||||
$subscription_total = $this->model_extension_opencart_report_customer_subscription->getTotalTransactions($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer_subscription->getTransactions($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['subscriptions'][] = [
|
||||
'customer' => $result['customer'],
|
||||
'email' => $result['email'],
|
||||
'customer_group' => $result['customer_group'],
|
||||
'status' => ($result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled')),
|
||||
'total' => $this->currency->format($result['total'], $this->config->get('config_currency')),
|
||||
'edit' => $this->url->link('customer/customer.form', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id'])
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$url .= '&filter_customer=' . urlencode($this->request->get['filter_customer']);
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $subscription_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/customer_subscription.report', 'user_token=' . $this->session->data['user_token'] . '&code=customer_subscription' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($subscription_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($subscription_total - $this->config->get('config_pagination'))) ? $subscription_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $subscription_total, ceil($subscription_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_customer'] = $filter_customer;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/customer_subscription_list', $data);
|
||||
}
|
||||
}
|
@ -0,0 +1,179 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class CustomerTransaction
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class CustomerTransaction extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/customer_transaction');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/customer_transaction', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/customer_transaction.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_customer_transaction_status'] = $this->config->get('report_customer_transaction_status');
|
||||
$data['report_customer_transaction_sort_order'] = $this->config->get('report_customer_transaction_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/opencart/report/customer_transaction_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/customer_transaction');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/customer_transaction')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_customer_transaction', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/customer_transaction');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/customer_transaction', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/customer_transaction');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$filter_customer = $this->request->get['filter_customer'];
|
||||
} else {
|
||||
$filter_customer = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['customers'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_customer' => $filter_customer,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/customer_transaction');
|
||||
|
||||
$customer_total = $this->model_extension_opencart_report_customer_transaction->getTotalTransactions($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_customer_transaction->getTransactions($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['customers'][] = [
|
||||
'customer' => $result['customer'],
|
||||
'email' => $result['email'],
|
||||
'customer_group' => $result['customer_group'],
|
||||
'status' => ($result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled')),
|
||||
'total' => $this->currency->format($result['total'], $this->config->get('config_currency')),
|
||||
'edit' => $this->url->link('customer/customer.form', 'user_token=' . $this->session->data['user_token'] . '&customer_id=' . $result['customer_id'])
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_customer'])) {
|
||||
$url .= '&filter_customer=' . urlencode($this->request->get['filter_customer']);
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $customer_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/customer_transaction.report', 'user_token=' . $this->session->data['user_token'] . '&code=customer_transaction' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($customer_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($customer_total - $this->config->get('config_pagination'))) ? $customer_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $customer_total, ceil($customer_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_customer'] = $filter_customer;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/customer_transaction_list', $data);
|
||||
}
|
||||
}
|
183
extension/opencart/admin/controller/report/marketing.php
Normal file
183
extension/opencart/admin/controller/report/marketing.php
Normal file
@ -0,0 +1,183 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class Marketing
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class Marketing extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/marketing');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/marketing', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/marketing.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_marketing_status'] = $this->config->get('report_marketing_status');
|
||||
$data['report_marketing_sort_order'] = $this->config->get('report_marketing_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/opencart/report/marketing_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/marketing');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/marketing')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_marketing', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/marketing');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/marketing', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/marketing');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$filter_order_status_id = (int)$this->request->get['filter_order_status_id'];
|
||||
} else {
|
||||
$filter_order_status_id = 0;
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['marketings'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_order_status_id' => $filter_order_status_id,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/marketing');
|
||||
|
||||
$marketing_total = $this->model_extension_opencart_report_marketing->getTotalMarketing($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_marketing->getMarketing($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['marketings'][] = [
|
||||
'campaign' => $result['campaign'],
|
||||
'code' => $result['code'],
|
||||
'clicks' => $result['clicks'],
|
||||
'orders' => $result['orders'],
|
||||
'total' => $this->currency->format((float)$result['total'], $this->config->get('config_currency')),
|
||||
'save' => $this->url->link('marketing/marketing/edit', 'user_token=' . $this->session->data['user_token'] . '&marketing_id=' . $result['marketing_id'])
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$url .= '&filter_order_status_id=' . $this->request->get['filter_order_status_id'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $marketing_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/marketing.report', 'user_token=' . $this->session->data['user_token'] . '&code=marketing' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($marketing_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($marketing_total - $this->config->get('config_pagination'))) ? $marketing_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $marketing_total, ceil($marketing_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_order_status_id'] = $filter_order_status_id;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/marketing_list', $data);
|
||||
}
|
||||
}
|
181
extension/opencart/admin/controller/report/product_purchased.php
Normal file
181
extension/opencart/admin/controller/report/product_purchased.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class ProductPurchased
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class ProductPurchased extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/product_purchased');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/product_purchased', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/product_purchased.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_product_purchased_status'] = $this->config->get('report_product_purchased_status');
|
||||
$data['report_product_purchased_sort_order'] = $this->config->get('report_product_purchased_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/opencart/report/product_purchased_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/product_purchased');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/product_purchased')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_product_purchased', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/product_purchased');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/product_purchased', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/product_purchased');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$filter_order_status_id = (int)$this->request->get['filter_order_status_id'];
|
||||
} else {
|
||||
$filter_order_status_id = 0;
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['products'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_order_status_id' => $filter_order_status_id,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/product_purchased');
|
||||
|
||||
$product_total = $this->model_extension_opencart_report_product_purchased->getTotalPurchased($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_product_purchased->getPurchased($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['products'][] = [
|
||||
'name' => $result['name'],
|
||||
'model' => $result['model'],
|
||||
'quantity' => $result['quantity'],
|
||||
'total' => $this->currency->format($result['total'], $this->config->get('config_currency'))
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$url .= '&filter_order_status_id=' . $this->request->get['filter_order_status_id'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $product_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/product_purchased.report', 'user_token=' . $this->session->data['user_token'] . '&code=product_purchased' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($product_total - $this->config->get('config_pagination'))) ? $product_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $product_total, ceil($product_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_order_status_id'] = $filter_order_status_id;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/product_purchased_list', $data);
|
||||
}
|
||||
}
|
227
extension/opencart/admin/controller/report/product_viewed.php
Normal file
227
extension/opencart/admin/controller/report/product_viewed.php
Normal file
@ -0,0 +1,227 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class ProductViewed
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class ProductViewed extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/product_viewed');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/product_viewed', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/product_viewed.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_product_viewed_status'] = $this->config->get('report_product_viewed_status');
|
||||
$data['report_product_viewed_sort_order'] = $this->config->get('report_product_viewed_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/opencart/report/product_viewed_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/product_viewed');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/product_viewed')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_product_viewed', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function install(): void {
|
||||
if ($this->user->hasPermission('modify', 'extension/report')) {
|
||||
$this->load->model('extension/opencart/report/product_viewed');
|
||||
|
||||
$this->model_extension_opencart_report_product_viewed->install();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function uninstall(): void {
|
||||
if ($this->user->hasPermission('modify', 'extension/report')) {
|
||||
$this->load->model('extension/opencart/report/product_viewed');
|
||||
|
||||
$this->model_extension_opencart_report_product_viewed->uninstall();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/product_viewed');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/product_viewed', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/product_viewed');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['products'] = [];
|
||||
|
||||
$this->load->model('extension/opencart/report/product_viewed');
|
||||
$this->load->model('catalog/product');
|
||||
|
||||
$total = $this->model_extension_opencart_report_product_viewed->getTotal();
|
||||
|
||||
$viewed_total = $this->model_extension_opencart_report_product_viewed->getTotalViewed();
|
||||
|
||||
$results = $this->model_extension_opencart_report_product_viewed->getViewed(($page - 1) * $this->config->get('config_pagination'), $this->config->get('config_pagination'));
|
||||
|
||||
foreach ($results as $result) {
|
||||
$product_info = $this->model_catalog_product->getProduct($result['product_id']);
|
||||
|
||||
if ($product_info) {
|
||||
if ($result['viewed']) {
|
||||
$percent = round(($result['viewed'] / $total) * 100, 2);
|
||||
} else {
|
||||
$percent = 0;
|
||||
}
|
||||
|
||||
$data['products'][] = [
|
||||
'name' => $product_info['name'],
|
||||
'model' => $product_info['model'],
|
||||
'viewed' => $result['viewed'],
|
||||
'percent' => $percent . '%'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$url .= '&page=' . $this->request->get['page'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $viewed_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/product_viewed.list', 'user_token=' . $this->session->data['user_token'] . '&code=product_viewed&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($viewed_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($viewed_total - $this->config->get('config_pagination'))) ? $viewed_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $viewed_total, ceil($viewed_total / $this->config->get('config_pagination')));
|
||||
|
||||
return $this->load->view('extension/opencart/report/product_viewed_list', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function generate(): void {
|
||||
$this->load->language('extension/opencart/report/product_viewed');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$limit = 10;
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/product_viewed')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('extension/opencart/report/product_viewed');
|
||||
|
||||
if ($page == 1) {
|
||||
$this->model_extension_opencart_report_product_viewed->clear();
|
||||
}
|
||||
|
||||
$filter_data = [
|
||||
'start' => ($page - 1) * $limit,
|
||||
'limit' => $limit
|
||||
];
|
||||
|
||||
$this->load->model('catalog/product');
|
||||
|
||||
$product_total = $this->model_catalog_product->getTotalProducts();
|
||||
|
||||
$products = $this->model_catalog_product->getProducts($filter_data);
|
||||
|
||||
foreach ($products as $product) {
|
||||
$this->model_extension_opencart_report_product_viewed->addReport($product['product_id'], $this->model_catalog_product->getTotalReports($product['product_id']));
|
||||
}
|
||||
|
||||
if (($page * $limit) <= $product_total) {
|
||||
$json['text'] = sprintf($this->language->get('text_progress'), ($page - 1) * $limit, $product_total);
|
||||
|
||||
$json['next'] = $this->url->link('extension/opencart/report/product_viewed.generate', 'user_token=' . $this->session->data['user_token'] . '&page=' . ($page + 1), true);
|
||||
} else {
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
166
extension/opencart/admin/controller/report/sale_coupon.php
Normal file
166
extension/opencart/admin/controller/report/sale_coupon.php
Normal file
@ -0,0 +1,166 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* CLass SaleCoupon
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class SaleCoupon extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/sale_coupon');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/sale_coupon', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/sale_coupon.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_sale_coupon_status'] = $this->config->get('report_sale_coupon_status');
|
||||
$data['report_sale_coupon_sort_order'] = $this->config->get('report_sale_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/opencart/report/sale_coupon_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/sale_coupon');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/sale_coupon')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_sale_coupon', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/sale_coupon');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/sale_coupon', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/sale_coupon');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['coupons'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/coupon');
|
||||
|
||||
$coupon_total = $this->model_extension_opencart_report_coupon->getTotalCoupons($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_coupon->getCoupons($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['coupons'][] = [
|
||||
'name' => $result['name'],
|
||||
'code' => $result['code'],
|
||||
'orders' => $result['orders'],
|
||||
'total' => $this->currency->format($result['total'], $this->config->get('config_currency')),
|
||||
'edit' => $this->url->link('marketing/coupon.edit', 'user_token=' . $this->session->data['user_token'] . '&coupon_id=' . $result['coupon_id'])
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $coupon_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/sale_coupon.report', 'user_token=' . $this->session->data['user_token'] . '&code=sale_coupon' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($coupon_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($coupon_total - $this->config->get('config_pagination'))) ? $coupon_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $coupon_total, ceil($coupon_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/sale_coupon_list', $data);
|
||||
}
|
||||
}
|
217
extension/opencart/admin/controller/report/sale_order.php
Normal file
217
extension/opencart/admin/controller/report/sale_order.php
Normal file
@ -0,0 +1,217 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class SaleOrder
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class SaleOrder extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/sale_order');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/sale_order', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/sale_order.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_sale_order_status'] = $this->config->get('report_sale_order_status');
|
||||
$data['report_sale_order_sort_order'] = $this->config->get('report_sale_order_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/opencart/report/sale_order_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/sale_order');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/sale_order')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_sale_order', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/sale_order');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['groups'] = [];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_year'),
|
||||
'value' => 'year',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_month'),
|
||||
'value' => 'month',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_week'),
|
||||
'value' => 'week',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_day'),
|
||||
'value' => 'day',
|
||||
];
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/sale_order', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/sale_order');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = date('Y-m-d', strtotime(date('Y') . '-' . date('m') . '-01'));
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = date('Y-m-d');
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_group'])) {
|
||||
$filter_group = $this->request->get['filter_group'];
|
||||
} else {
|
||||
$filter_group = 'week';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$filter_order_status_id = (int)$this->request->get['filter_order_status_id'];
|
||||
} else {
|
||||
$filter_order_status_id = 0;
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['orders'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_group' => $filter_group,
|
||||
'filter_order_status_id' => $filter_order_status_id,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/sale');
|
||||
|
||||
$order_total = $this->model_extension_opencart_report_sale->getTotalOrders($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_sale->getOrders($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['orders'][] = [
|
||||
'date_start' => date($this->language->get('date_format_short'), strtotime($result['date_start'])),
|
||||
'date_end' => date($this->language->get('date_format_short'), strtotime($result['date_end'])),
|
||||
'orders' => $result['orders'],
|
||||
'products' => $result['products'],
|
||||
'tax' => $this->currency->format((float)$result['tax'], $this->config->get('config_currency')),
|
||||
'total' => $this->currency->format((float)$result['total'], $this->config->get('config_currency'))
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_group'])) {
|
||||
$url .= '&filter_group=' . $this->request->get['filter_group'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$url .= '&filter_order_status_id=' . $this->request->get['filter_order_status_id'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $order_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/sale_order', 'user_token=' . $this->session->data['user_token'] . '&code=sale_order' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($order_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($order_total - $this->config->get('config_pagination'))) ? $order_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $order_total, ceil($order_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_group'] = $filter_group;
|
||||
$data['filter_order_status_id'] = $filter_order_status_id;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/sale_order_list', $data);
|
||||
}
|
||||
}
|
214
extension/opencart/admin/controller/report/sale_return.php
Normal file
214
extension/opencart/admin/controller/report/sale_return.php
Normal file
@ -0,0 +1,214 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class Sale Return
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class SaleReturn extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/sale_return');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/sale_return', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/sale_return.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_sale_return_status'] = $this->config->get('report_sale_return_status');
|
||||
$data['report_sale_return_sort_order'] = $this->config->get('report_sale_return_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/opencart/report/sale_return_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/sale_coupon');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/sale_return')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_sale_return', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/sale_return');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$this->load->model('localisation/return_status');
|
||||
|
||||
$data['return_statuses'] = $this->model_localisation_return_status->getReturnStatuses();
|
||||
|
||||
$data['groups'] = [];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_year'),
|
||||
'value' => 'year',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_month'),
|
||||
'value' => 'month',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_week'),
|
||||
'value' => 'week',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_day'),
|
||||
'value' => 'day',
|
||||
];
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/sale_return', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/sale_return');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_group'])) {
|
||||
$filter_group = $this->request->get['filter_group'];
|
||||
} else {
|
||||
$filter_group = 'week';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_return_status_id'])) {
|
||||
$filter_return_status_id = (int)$this->request->get['filter_return_status_id'];
|
||||
} else {
|
||||
$filter_return_status_id = 0;
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['returns'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_group' => $filter_group,
|
||||
'filter_return_status_id' => $filter_return_status_id,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/returns');
|
||||
|
||||
$return_total = $this->model_extension_opencart_report_returns->getTotalReturns($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_returns->getReturns($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['returns'][] = [
|
||||
'date_start' => date($this->language->get('date_format_short'), strtotime($result['date_start'])),
|
||||
'date_end' => date($this->language->get('date_format_short'), strtotime($result['date_end'])),
|
||||
'returns' => $result['returns']
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_group'])) {
|
||||
$url .= '&filter_group=' . $this->request->get['filter_group'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_return_status_id'])) {
|
||||
$url .= '&filter_return_status_id=' . $this->request->get['filter_return_status_id'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $return_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/sale_return.report', 'user_token=' . $this->session->data['user_token'] . '&code=sale_return' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($return_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($return_total - $this->config->get('config_pagination'))) ? $return_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $return_total, ceil($return_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_group'] = $filter_group;
|
||||
$data['filter_return_status_id'] = $filter_return_status_id;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/sale_return_list', $data);
|
||||
}
|
||||
}
|
216
extension/opencart/admin/controller/report/sale_shipping.php
Normal file
216
extension/opencart/admin/controller/report/sale_shipping.php
Normal file
@ -0,0 +1,216 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class Sale Shipping
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class SaleShipping extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/sale_shipping');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/sale_shipping', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/sale_shipping.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_sale_shipping_status'] = $this->config->get('report_sale_shipping_status');
|
||||
$data['report_sale_shipping_sort_order'] = $this->config->get('report_sale_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/opencart/report/sale_shipping_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/sale_shipping');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/sale_shipping')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_sale_shipping', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/sale_shipping');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['groups'] = [];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_year'),
|
||||
'value' => 'year',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_month'),
|
||||
'value' => 'month',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_week'),
|
||||
'value' => 'week',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_day'),
|
||||
'value' => 'day',
|
||||
];
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/sale_shipping', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/sale_shipping');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_group'])) {
|
||||
$filter_group = $this->request->get['filter_group'];
|
||||
} else {
|
||||
$filter_group = 'week';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$filter_order_status_id = (int)$this->request->get['filter_order_status_id'];
|
||||
} else {
|
||||
$filter_order_status_id = 0;
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['orders'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_group' => $filter_group,
|
||||
'filter_order_status_id' => $filter_order_status_id,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/sale');
|
||||
|
||||
$order_total = $this->model_extension_opencart_report_sale->getTotalShipping($filter_data);
|
||||
|
||||
$results = $this->model_extension_opencart_report_sale->getShipping($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['orders'][] = [
|
||||
'date_start' => date($this->language->get('date_format_short'), strtotime($result['date_start'])),
|
||||
'date_end' => date($this->language->get('date_format_short'), strtotime($result['date_end'])),
|
||||
'title' => $result['title'],
|
||||
'orders' => $result['orders'],
|
||||
'total' => $this->currency->format($result['total'], $this->config->get('config_currency'))
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_group'])) {
|
||||
$url .= '&filter_group=' . $this->request->get['filter_group'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$url .= '&filter_order_status_id=' . $this->request->get['filter_order_status_id'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $order_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/sale_shipping.list', 'user_token=' . $this->session->data['user_token'] . '&code=sale_shipping' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($order_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($order_total - $this->config->get('config_pagination'))) ? $order_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $order_total, ceil($order_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_group'] = $filter_group;
|
||||
$data['filter_order_status_id'] = $filter_order_status_id;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/sale_shipping_list', $data);
|
||||
}
|
||||
}
|
218
extension/opencart/admin/controller/report/sale_tax.php
Normal file
218
extension/opencart/admin/controller/report/sale_tax.php
Normal file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Report;
|
||||
/**
|
||||
* Class Sale Tax
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Report
|
||||
*/
|
||||
class SaleTax extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/report/sale_tax');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/report/sale_tax', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/report/sale_tax.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report');
|
||||
|
||||
$data['report_sale_tax_status'] = $this->config->get('report_sale_tax_status');
|
||||
$data['report_sale_tax_sort_order'] = $this->config->get('report_sale_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/opencart/report/sale_tax_form', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/report/sale_tax');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/report/sale_tax')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('report_sale_tax', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function report(): void {
|
||||
$this->load->language('extension/opencart/report/sale_tax');
|
||||
|
||||
$data['list'] = $this->getReport();
|
||||
|
||||
$this->load->model('localisation/order_status');
|
||||
|
||||
$data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
|
||||
|
||||
$data['groups'] = [];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_year'),
|
||||
'value' => 'year',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_month'),
|
||||
'value' => 'month',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_week'),
|
||||
'value' => 'week',
|
||||
];
|
||||
|
||||
$data['groups'][] = [
|
||||
'text' => $this->language->get('text_day'),
|
||||
'value' => 'day',
|
||||
];
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
$this->response->setOutput($this->load->view('extension/opencart/report/sale_tax', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function list(): void {
|
||||
$this->load->language('extension/opencart/report/sale_tax');
|
||||
|
||||
$this->response->setOutput($this->getReport());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getReport(): string {
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$filter_date_start = $this->request->get['filter_date_start'];
|
||||
} else {
|
||||
$filter_date_start = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$filter_date_end = $this->request->get['filter_date_end'];
|
||||
} else {
|
||||
$filter_date_end = '';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_group'])) {
|
||||
$filter_group = $this->request->get['filter_group'];
|
||||
} else {
|
||||
$filter_group = 'week';
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$filter_order_status_id = (int)$this->request->get['filter_order_status_id'];
|
||||
} else {
|
||||
$filter_order_status_id = 0;
|
||||
}
|
||||
|
||||
if (isset($this->request->get['page'])) {
|
||||
$page = (int)$this->request->get['page'];
|
||||
} else {
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$data['orders'] = [];
|
||||
|
||||
$filter_data = [
|
||||
'filter_date_start' => $filter_date_start,
|
||||
'filter_date_end' => $filter_date_end,
|
||||
'filter_group' => $filter_group,
|
||||
'filter_order_status_id' => $filter_order_status_id,
|
||||
'start' => ($page - 1) * $this->config->get('config_pagination'),
|
||||
'limit' => $this->config->get('config_pagination')
|
||||
];
|
||||
|
||||
$this->load->model('extension/opencart/report/sale');
|
||||
|
||||
$order_total = $this->model_extension_opencart_report_sale->getTotalTaxes($filter_data);
|
||||
|
||||
$data['orders'] = [];
|
||||
|
||||
$results = $this->model_extension_opencart_report_sale->getTaxes($filter_data);
|
||||
|
||||
foreach ($results as $result) {
|
||||
$data['orders'][] = [
|
||||
'date_start' => date($this->language->get('date_format_short'), strtotime($result['date_start'])),
|
||||
'date_end' => date($this->language->get('date_format_short'), strtotime($result['date_end'])),
|
||||
'title' => $result['title'],
|
||||
'orders' => $result['orders'],
|
||||
'total' => $this->currency->format($result['total'], $this->config->get('config_currency'))
|
||||
];
|
||||
}
|
||||
|
||||
$url = '';
|
||||
|
||||
if (isset($this->request->get['filter_date_start'])) {
|
||||
$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_date_end'])) {
|
||||
$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_group'])) {
|
||||
$url .= '&filter_group=' . $this->request->get['filter_group'];
|
||||
}
|
||||
|
||||
if (isset($this->request->get['filter_order_status_id'])) {
|
||||
$url .= '&filter_order_status_id=' . $this->request->get['filter_order_status_id'];
|
||||
}
|
||||
|
||||
$data['pagination'] = $this->load->controller('common/pagination', [
|
||||
'total' => $order_total,
|
||||
'page' => $page,
|
||||
'limit' => $this->config->get('config_pagination'),
|
||||
'url' => $this->url->link('extension/opencart/report/sale_tax.report', 'user_token=' . $this->session->data['user_token'] . '&code=sale_tax' . $url . '&page={page}')
|
||||
]);
|
||||
|
||||
$data['results'] = sprintf($this->language->get('text_pagination'), ($order_total) ? (($page - 1) * $this->config->get('config_pagination')) + 1 : 0, ((($page - 1) * $this->config->get('config_pagination')) > ($order_total - $this->config->get('config_pagination'))) ? $order_total : ((($page - 1) * $this->config->get('config_pagination')) + $this->config->get('config_pagination')), $order_total, ceil($order_total / $this->config->get('config_pagination')));
|
||||
|
||||
$data['filter_date_start'] = $filter_date_start;
|
||||
$data['filter_date_end'] = $filter_date_end;
|
||||
$data['filter_group'] = $filter_group;
|
||||
$data['filter_order_status_id'] = $filter_order_status_id;
|
||||
|
||||
$data['user_token'] = $this->session->data['user_token'];
|
||||
|
||||
return $this->load->view('extension/opencart/report/sale_tax_list', $data);
|
||||
}
|
||||
}
|
76
extension/opencart/admin/controller/shipping/flat.php
Normal file
76
extension/opencart/admin/controller/shipping/flat.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Shipping;
|
||||
/**
|
||||
* Class Flat
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Shipping
|
||||
*/
|
||||
class Flat extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* index
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/shipping/flat');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = ['text' => $this->language->get('text_home'), 'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])];
|
||||
|
||||
$data['breadcrumbs'][] = ['text' => $this->language->get('text_extension'), 'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=shipping')];
|
||||
|
||||
$data['breadcrumbs'][] = ['text' => $this->language->get('heading_title'), 'href' => $this->url->link('extension/opencart/shipping/flat', 'user_token=' . $this->session->data['user_token'])];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/shipping/flat.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=shipping');
|
||||
|
||||
$data['shipping_flat_cost'] = $this->config->get('shipping_flat_cost');
|
||||
$data['shipping_flat_tax_class_id'] = $this->config->get('shipping_flat_tax_class_id');
|
||||
|
||||
$this->load->model('localisation/tax_class');
|
||||
|
||||
$data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();
|
||||
|
||||
$data['shipping_flat_geo_zone_id'] = $this->config->get('shipping_flat_geo_zone_id');
|
||||
|
||||
$this->load->model('localisation/geo_zone');
|
||||
|
||||
$data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones();
|
||||
|
||||
$data['shipping_flat_status'] = $this->config->get('shipping_flat_status');
|
||||
$data['shipping_flat_sort_order'] = $this->config->get('shipping_flat_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/opencart/shipping/flat', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/shipping/flat');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/shipping/flat')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('shipping_flat', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
77
extension/opencart/admin/controller/shipping/free.php
Normal file
77
extension/opencart/admin/controller/shipping/free.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Shipping;
|
||||
/**
|
||||
* Class Free
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Shipping
|
||||
*/
|
||||
class Free extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/shipping/free');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=shipping')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/shipping/free', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/shipping/free.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=shipping');
|
||||
|
||||
$data['shipping_free_total'] = $this->config->get('shipping_free_total');
|
||||
$data['shipping_free_geo_zone_id'] = $this->config->get('shipping_free_geo_zone_id');
|
||||
|
||||
$this->load->model('localisation/geo_zone');
|
||||
|
||||
$data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones();
|
||||
|
||||
$data['shipping_free_status'] = $this->config->get('shipping_free_status');
|
||||
$data['shipping_free_sort_order'] = $this->config->get('shipping_free_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/opencart/shipping/free', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/shipping/free');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/shipping/free')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('shipping_free', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
82
extension/opencart/admin/controller/shipping/item.php
Normal file
82
extension/opencart/admin/controller/shipping/item.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Shipping;
|
||||
/**
|
||||
* Class Item
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Shipping
|
||||
*/
|
||||
class Item extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/shipping/item');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=shipping')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/shipping/item', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/shipping/item.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=shipping');
|
||||
|
||||
$data['shipping_item_cost'] = $this->config->get('shipping_item_cost');
|
||||
$data['shipping_item_tax_class_id'] = $this->config->get('shipping_item_tax_class_id');
|
||||
|
||||
$this->load->model('localisation/tax_class');
|
||||
|
||||
$data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();
|
||||
$data['shipping_item_geo_zone_id'] = $this->config->get('shipping_item_geo_zone_id');
|
||||
|
||||
$this->load->model('localisation/geo_zone');
|
||||
|
||||
$data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones();
|
||||
|
||||
$data['shipping_item_status'] = $this->config->get('shipping_item_status');
|
||||
$data['shipping_item_sort_order'] = $this->config->get('shipping_item_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/opencart/shipping/item', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/shipping/item');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/shipping/item')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('shipping_item', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
76
extension/opencart/admin/controller/shipping/pickup.php
Normal file
76
extension/opencart/admin/controller/shipping/pickup.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Shipping;
|
||||
/**
|
||||
* Class Pickup
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Shipping
|
||||
*/
|
||||
class Pickup extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/shipping/pickup');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=shipping')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/shipping/pickup', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/shipping/pickup.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=shipping');
|
||||
|
||||
$data['shipping_pickup_geo_zone_id'] = $this->config->get('shipping_pickup_geo_zone_id');
|
||||
|
||||
$this->load->model('localisation/geo_zone');
|
||||
|
||||
$data['geo_zones'] = $this->model_localisation_geo_zone->getGeoZones();
|
||||
|
||||
$data['shipping_pickup_status'] = $this->config->get('shipping_pickup_status');
|
||||
$data['shipping_pickup_sort_order'] = $this->config->get('shipping_pickup_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/opencart/shipping/pickup', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/shipping/pickup');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/shipping/pickup')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('shipping_pickup', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
87
extension/opencart/admin/controller/shipping/weight.php
Normal file
87
extension/opencart/admin/controller/shipping/weight.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Shipping;
|
||||
/**
|
||||
* Class Weight
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Shipping
|
||||
*/
|
||||
class Weight extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/shipping/weight');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=shipping')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/shipping/weight', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/shipping/weight.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=shipping');
|
||||
|
||||
$this->load->model('localisation/geo_zone');
|
||||
|
||||
$geo_zones = $this->model_localisation_geo_zone->getGeoZones();
|
||||
|
||||
foreach ($geo_zones as $geo_zone) {
|
||||
$data['shipping_weight_geo_zone_rate'][$geo_zone['geo_zone_id']] = $this->config->get('shipping_weight_' . $geo_zone['geo_zone_id'] . '_rate');
|
||||
$data['shipping_weight_geo_zone_status'][$geo_zone['geo_zone_id']] = $this->config->get('shipping_weight_' . $geo_zone['geo_zone_id'] . '_status');
|
||||
}
|
||||
|
||||
$data['geo_zones'] = $geo_zones;
|
||||
|
||||
$data['shipping_weight_tax_class_id'] = $this->config->get('shipping_weight_tax_class_id');
|
||||
|
||||
$this->load->model('localisation/tax_class');
|
||||
|
||||
$data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();
|
||||
|
||||
$data['shipping_weight_status'] = $this->config->get('shipping_weight_status');
|
||||
$data['shipping_weight_sort_order'] = $this->config->get('shipping_weight_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/opencart/shipping/weight', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/shipping/weight');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/shipping/weight')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('shipping_weight', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
91
extension/opencart/admin/controller/theme/basic.php
Normal file
91
extension/opencart/admin/controller/theme/basic.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Theme;
|
||||
/**
|
||||
* Class Basic
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Theme
|
||||
*/
|
||||
class Basic extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/theme/basic');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
if (isset($this->request->get['store_id'])) {
|
||||
$store_id = (int)$this->request->get['store_id'];
|
||||
} else {
|
||||
$store_id = 0;
|
||||
}
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=theme')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/theme/basic', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $store_id)
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/theme/basic.save', 'user_token=' . $this->session->data['user_token'] . '&store_id=' . $store_id);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=theme');
|
||||
|
||||
if (isset($this->request->get['store_id'])) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$setting_info = $this->model_setting_setting->getSetting('theme_basic', $this->request->get['store_id']);
|
||||
}
|
||||
|
||||
if (isset($setting_info['theme_basic_status'])) {
|
||||
$data['theme_basic_status'] = $setting_info['theme_basic_status'];
|
||||
} else {
|
||||
$data['theme_basic_status'] = '';
|
||||
}
|
||||
|
||||
$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/opencart/theme/basic', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/theme/basic');
|
||||
|
||||
if (isset($this->request->get['store_id'])) {
|
||||
$store_id = (int)$this->request->get['store_id'];
|
||||
} else {
|
||||
$store_id = 0;
|
||||
}
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/theme/basic')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('theme_basic', $this->request->post, $store_id);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
70
extension/opencart/admin/controller/total/coupon.php
Normal file
70
extension/opencart/admin/controller/total/coupon.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Total;
|
||||
/**
|
||||
* Class Coupon
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Total
|
||||
*/
|
||||
class Coupon extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/total/coupon');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/total/coupon', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/total/coupon.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total');
|
||||
|
||||
$data['total_coupon_status'] = $this->config->get('total_coupon_status');
|
||||
$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/opencart/total/coupon', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/total/coupon');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/total/coupon')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('total_coupon', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
70
extension/opencart/admin/controller/total/credit.php
Normal file
70
extension/opencart/admin/controller/total/credit.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Total;
|
||||
/**
|
||||
* Class Credit
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Total
|
||||
*/
|
||||
class Credit extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/total/credit');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/total/credit', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/total/credit.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total');
|
||||
|
||||
$data['total_credit_status'] = $this->config->get('total_credit_status');
|
||||
$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/opencart/total/credit', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/total/credit');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/total/credit')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('total_credit', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
78
extension/opencart/admin/controller/total/handling.php
Normal file
78
extension/opencart/admin/controller/total/handling.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Total;
|
||||
/**
|
||||
* Class Handling
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Total
|
||||
*/
|
||||
class Handling extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/total/handling');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/total/handling', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/total/handling.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total');
|
||||
|
||||
$data['total_handling_total'] = $this->config->get('total_handling_total');
|
||||
$data['total_handling_fee'] = $this->config->get('total_handling_fee');
|
||||
$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();
|
||||
|
||||
$data['total_handling_status'] = $this->config->get('total_handling_status');
|
||||
$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/opencart/total/handling', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/total/handling');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/total/handling')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('total_handling', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
78
extension/opencart/admin/controller/total/low_order_fee.php
Normal file
78
extension/opencart/admin/controller/total/low_order_fee.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Total;
|
||||
/**
|
||||
* Class Low Order Fee
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Total
|
||||
*/
|
||||
class LowOrderFee extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/total/low_order_fee');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/total/low_order_fee', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/total/low_order_fee.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total');
|
||||
|
||||
$data['total_low_order_fee_total'] = $this->config->get('total_low_order_fee_total');
|
||||
$data['total_low_order_fee_fee'] = $this->config->get('total_low_order_fee_fee');
|
||||
$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();
|
||||
|
||||
$data['total_low_order_fee_status'] = $this->config->get('total_low_order_fee_status');
|
||||
$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/opencart/total/low_order_fee', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/total/low_order_fee');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/total/low_order_fee')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('total_low_order_fee', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
70
extension/opencart/admin/controller/total/reward.php
Normal file
70
extension/opencart/admin/controller/total/reward.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Total;
|
||||
/**
|
||||
* Class Reward
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Total
|
||||
*/
|
||||
class Reward extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/total/reward');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/total/reward', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/total/reward.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total');
|
||||
|
||||
$data['total_reward_status'] = $this->config->get('total_reward_status');
|
||||
$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/opencart/total/reward', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/total/reward');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/total/reward')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('total_reward', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
71
extension/opencart/admin/controller/total/shipping.php
Normal file
71
extension/opencart/admin/controller/total/shipping.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Total;
|
||||
/**
|
||||
* Class Shipping
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Total
|
||||
*/
|
||||
class Shipping extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/total/shipping');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/total/shipping', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/total/shipping.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total');
|
||||
|
||||
$data['total_shipping_estimator'] = $this->config->get('total_shipping_estimator');
|
||||
$data['total_shipping_status'] = $this->config->get('total_shipping_status');
|
||||
$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/opencart/total/shipping', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/total/shipping');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/total/shipping')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('total_shipping', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
70
extension/opencart/admin/controller/total/sub_total.php
Normal file
70
extension/opencart/admin/controller/total/sub_total.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Total;
|
||||
/**
|
||||
* Class Sub Total
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Total
|
||||
*/
|
||||
class SubTotal extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/total/sub_total');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/total/sub_total', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/total/sub_total.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total');
|
||||
|
||||
$data['total_sub_total_status'] = $this->config->get('total_sub_total_status');
|
||||
$data['total_sub_total_sort_order'] = $this->config->get('total_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/opencart/total/sub_total', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/total/sub_total');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/total/sub_total')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('total_sub_total', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
75
extension/opencart/admin/controller/total/tax.php
Normal file
75
extension/opencart/admin/controller/total/tax.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Total;
|
||||
/**
|
||||
* Class Tax
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Total
|
||||
*/
|
||||
class Tax extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private array $error = [];
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/total/tax');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/total/tax', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/total/tax.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total');
|
||||
|
||||
$data['total_tax_status'] = $this->config->get('total_tax_status');
|
||||
$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/opencart/total/tax', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/total/tax');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/total/tax')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('total_tax', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
70
extension/opencart/admin/controller/total/total.php
Normal file
70
extension/opencart/admin/controller/total/total.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Total;
|
||||
/**
|
||||
* Class Total
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Total
|
||||
*/
|
||||
class Total extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/total/total');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/total/total', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/total/total.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total');
|
||||
|
||||
$data['total_total_status'] = $this->config->get('total_total_status');
|
||||
$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/opencart/total/total', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/total/total');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/total/total')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('total_total', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
70
extension/opencart/admin/controller/total/voucher.php
Normal file
70
extension/opencart/admin/controller/total/voucher.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
namespace Opencart\Admin\Controller\Extension\Opencart\Total;
|
||||
/**
|
||||
* Class Voucher
|
||||
*
|
||||
* @package Opencart\Admin\Controller\Extension\Opencart\Total
|
||||
*/
|
||||
class Voucher extends \Opencart\System\Engine\Controller {
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index(): void {
|
||||
$this->load->language('extension/opencart/total/voucher');
|
||||
|
||||
$this->document->setTitle($this->language->get('heading_title'));
|
||||
|
||||
$data['breadcrumbs'] = [];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_home'),
|
||||
'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('text_extension'),
|
||||
'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total')
|
||||
];
|
||||
|
||||
$data['breadcrumbs'][] = [
|
||||
'text' => $this->language->get('heading_title'),
|
||||
'href' => $this->url->link('extension/opencart/total/voucher', 'user_token=' . $this->session->data['user_token'])
|
||||
];
|
||||
|
||||
$data['save'] = $this->url->link('extension/opencart/total/voucher.save', 'user_token=' . $this->session->data['user_token']);
|
||||
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=total');
|
||||
|
||||
$data['total_voucher_status'] = $this->config->get('total_voucher_status');
|
||||
$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/opencart/total/voucher', $data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function save(): void {
|
||||
$this->load->language('extension/opencart/total/voucher');
|
||||
|
||||
$json = [];
|
||||
|
||||
if (!$this->user->hasPermission('modify', 'extension/opencart/total/voucher')) {
|
||||
$json['error'] = $this->language->get('error_permission');
|
||||
}
|
||||
|
||||
if (!$json) {
|
||||
$this->load->model('setting/setting');
|
||||
|
||||
$this->model_setting_setting->editSetting('total_voucher', $this->request->post);
|
||||
|
||||
$json['success'] = $this->language->get('text_success');
|
||||
}
|
||||
|
||||
$this->response->addHeader('Content-Type: application/json');
|
||||
$this->response->setOutput(json_encode($json));
|
||||
}
|
||||
}
|
14
extension/opencart/admin/language/en-gb/captcha/basic.php
Normal file
14
extension/opencart/admin/language/en-gb/captcha/basic.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Basic Captcha';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified Basic Captcha!';
|
||||
$_['text_edit'] = 'Edit Basic Captcha';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify Basic Captcha!';
|
15
extension/opencart/admin/language/en-gb/currency/ecb.php
Normal file
15
extension/opencart/admin/language/en-gb/currency/ecb.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'European Central Bank Currency Converter';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified European Central Bank Currency Converter!';
|
||||
$_['text_edit'] = 'Edit European Central Bank';
|
||||
$_['text_support'] = 'This extension requires at EUR currency to be available currency option.';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify European Central Bank Currency Converter!';
|
17
extension/opencart/admin/language/en-gb/currency/fixer.php
Normal file
17
extension/opencart/admin/language/en-gb/currency/fixer.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Fixer';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified fixer currency rates!';
|
||||
$_['text_edit'] = 'Edit Fixer';
|
||||
$_['text_signup'] = 'Fixer.io is a currency conversion service <a href="https://fixer.io/" target="_blank" class="alert-link">signup here</a>.';
|
||||
|
||||
// Entry
|
||||
$_['entry_api'] = 'API Access Key';
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify fixer currency rates!';
|
||||
$_['error_api'] = 'API Access Key required!';
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Recent Activity';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified dashboard activity!';
|
||||
$_['text_edit'] = 'Edit Dashboard Recent Activity';
|
||||
$_['text_activity_register'] = '<a href="customer_id=%d">%s</a> registered a new account.';
|
||||
$_['text_activity_edit'] = '<a href="customer_id=%d">%s</a> updated their account details.';
|
||||
$_['text_activity_password'] = '<a href="customer_id=%d">%s</a> updated their account password.';
|
||||
$_['text_activity_reset'] = '<a href="customer_id=%d">%s</a> reset their account password.';
|
||||
$_['text_activity_login'] = '<a href="customer_id=%d">%s</a> logged in.';
|
||||
$_['text_activity_forgotten'] = '<a href="customer_id=%d">%s</a> has requested a reset password.';
|
||||
$_['text_activity_address_add'] = '<a href="customer_id=%d">%s</a> added a new address.';
|
||||
$_['text_activity_address_edit'] = '<a href="customer_id=%d">%s</a> updated their address.';
|
||||
$_['text_activity_address_delete'] = '<a href="customer_id=%d">%s</a> deleted one of their addresses.';
|
||||
$_['text_activity_return_account'] = '<a href="customer_id=%d">%s</a> submitted a product <a href="return_id=%d">return</a>.';
|
||||
$_['text_activity_return_guest'] = '%s submitted a product <a href="return_id=%d">return</a>.';
|
||||
$_['text_activity_order_account'] = '<a href="customer_id=%d">%s</a> added a <a href="order_id=%d">new order</a>.';
|
||||
$_['text_activity_order_guest'] = '%s created a <a href="order_id=%d">new order</a>.';
|
||||
$_['text_activity_affiliate_add'] = '<a href="customer_id=%d">%s</a> registered for a affiliate account.';
|
||||
$_['text_activity_affiliate_edit'] = '<a href="customer_id=%d">%s</a> updated their affiliate details.';
|
||||
$_['text_activity_transaction'] = '<a href="customer_id=%d">%s</a> received commission from an new <a href="order_id=%d">order</a>.';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
$_['entry_width'] = 'Width';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify dashboard activity!';
|
22
extension/opencart/admin/language/en-gb/dashboard/chart.php
Normal file
22
extension/opencart/admin/language/en-gb/dashboard/chart.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Sales Analytics';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified dashboard chart!';
|
||||
$_['text_edit'] = 'Edit Dashboard Chart';
|
||||
$_['text_order'] = 'Orders';
|
||||
$_['text_customer'] = 'Customers';
|
||||
$_['text_day'] = 'Today';
|
||||
$_['text_week'] = 'Week';
|
||||
$_['text_month'] = 'Month';
|
||||
$_['text_year'] = 'Year';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
$_['entry_width'] = 'Width';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify dashboard chart!';
|
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Total Customers';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified dashboard customer!';
|
||||
$_['text_edit'] = 'Edit Dashboard Customer';
|
||||
$_['text_view'] = 'View more...';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
$_['entry_width'] = 'Width';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify dashboard customer!';
|
18
extension/opencart/admin/language/en-gb/dashboard/map.php
Normal file
18
extension/opencart/admin/language/en-gb/dashboard/map.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'World Map';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified dashboard map!';
|
||||
$_['text_edit'] = 'Edit Dashboard Map';
|
||||
$_['text_order'] = 'Orders';
|
||||
$_['text_sale'] = 'Sales';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
$_['entry_width'] = 'Width';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify dashboard map!';
|
17
extension/opencart/admin/language/en-gb/dashboard/online.php
Normal file
17
extension/opencart/admin/language/en-gb/dashboard/online.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'People Online';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified dashboard online!';
|
||||
$_['text_edit'] = 'Edit Dashboard Online';
|
||||
$_['text_view'] = 'View more...';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
$_['entry_width'] = 'Width';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify dashboard online!';
|
17
extension/opencart/admin/language/en-gb/dashboard/order.php
Normal file
17
extension/opencart/admin/language/en-gb/dashboard/order.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Total Orders';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified dashboard orders!';
|
||||
$_['text_edit'] = 'Edit Dashboard Orders';
|
||||
$_['text_view'] = 'View more...';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
$_['entry_width'] = 'Width';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify dashboard orders!';
|
24
extension/opencart/admin/language/en-gb/dashboard/recent.php
Normal file
24
extension/opencart/admin/language/en-gb/dashboard/recent.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Latest Orders';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified dashboard recent orders!';
|
||||
$_['text_edit'] = 'Edit Dashboard Recent Orders';
|
||||
|
||||
// Column
|
||||
$_['column_order_id'] = 'Order ID';
|
||||
$_['column_customer'] = 'Customer';
|
||||
$_['column_status'] = 'Status';
|
||||
$_['column_total'] = 'Total';
|
||||
$_['column_date_added'] = 'Date Added';
|
||||
$_['column_action'] = 'Action';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
$_['entry_width'] = 'Width';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify dashboard recent orders!';
|
17
extension/opencart/admin/language/en-gb/dashboard/sale.php
Normal file
17
extension/opencart/admin/language/en-gb/dashboard/sale.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Total Sales';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified dashboard sales!';
|
||||
$_['text_edit'] = 'Edit Dashboard Sales';
|
||||
$_['text_view'] = 'View more...';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
$_['entry_width'] = 'Width';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify dashboard sales!';
|
29
extension/opencart/admin/language/en-gb/fraud/ip.php
Normal file
29
extension/opencart/admin/language/en-gb/fraud/ip.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Anti-Fraud IP';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified Anti-Fraud IP!';
|
||||
$_['text_edit'] = 'Edit Anti-Fraud IP';
|
||||
$_['text_ip_add'] = 'Add IP Address';
|
||||
$_['text_ip_list'] = 'Fraud IP Address List';
|
||||
|
||||
// Column
|
||||
$_['column_ip'] = 'IP';
|
||||
$_['column_total'] = 'Total Accounts';
|
||||
$_['column_date_added'] = 'Date Added';
|
||||
$_['column_action'] = 'Action';
|
||||
|
||||
// Entry
|
||||
$_['entry_ip'] = 'IP';
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_order_status'] = 'Order Status';
|
||||
|
||||
// Help
|
||||
$_['help_order_status'] = 'Customers that have a banned IP on their accounts will be assigned this order status and will not be allowed to reach the complete status automatically.';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify Anti-Fraud IP!';
|
||||
$_['error_required'] = 'IP Address required!';
|
||||
$_['error_invalid'] = 'IP Address invalid!';
|
14
extension/opencart/admin/language/en-gb/module/account.php
Normal file
14
extension/opencart/admin/language/en-gb/module/account.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Account';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified account module!';
|
||||
$_['text_edit'] = 'Edit Account Module';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify account module!';
|
32
extension/opencart/admin/language/en-gb/module/banner.php
Normal file
32
extension/opencart/admin/language/en-gb/module/banner.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Banner';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified banner module!';
|
||||
$_['text_edit'] = 'Edit Banner Module';
|
||||
$_['text_slide'] = 'Slide';
|
||||
$_['text_fade'] = 'Fade';
|
||||
|
||||
// Entry
|
||||
$_['entry_name'] = 'Module Name';
|
||||
$_['entry_banner'] = 'Banner';
|
||||
$_['entry_effect'] = 'Effect';
|
||||
$_['entry_items'] = 'Items per Slide';
|
||||
$_['entry_controls'] = 'Controls';
|
||||
$_['entry_indicators'] = 'Indicators';
|
||||
$_['entry_interval'] = 'Interval';
|
||||
$_['entry_width'] = 'Width';
|
||||
$_['entry_height'] = 'Height';
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Help
|
||||
$_['help_items'] = 'The number of items to show per slide.';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify banner module!';
|
||||
$_['error_name'] = 'Module Name must be between 3 and 64 characters!';
|
||||
$_['error_interval'] = 'Interval required!';
|
||||
$_['error_width'] = 'Width required!';
|
||||
$_['error_height'] = 'Height required!';
|
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Best Sellers';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified best sellers module!';
|
||||
$_['text_next'] = 'Success: You have modified %s best sellers out of %s!';
|
||||
$_['text_edit'] = 'Edit Best Sellers Module';
|
||||
$_['text_horizontal'] = 'Horizontal';
|
||||
$_['text_vertical'] = 'Vertical';
|
||||
$_['text_report'] = 'Reports';
|
||||
|
||||
// Column
|
||||
$_['column_product'] = 'Product';
|
||||
$_['column_total'] = 'Total';
|
||||
|
||||
// Entry
|
||||
$_['entry_name'] = 'Module Name';
|
||||
$_['entry_axis'] = 'Axis';
|
||||
$_['entry_limit'] = 'Limit';
|
||||
$_['entry_width'] = 'Image Width';
|
||||
$_['entry_height'] = 'Image Height';
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Button
|
||||
$_['button_sync'] = 'Generate Best Sellers List';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify best sellers module!';
|
||||
$_['error_name'] = 'Module Name must be between 3 and 64 characters!';
|
||||
$_['error_width'] = 'Width required!';
|
||||
$_['error_height'] = 'Height required!';
|
14
extension/opencart/admin/language/en-gb/module/category.php
Normal file
14
extension/opencart/admin/language/en-gb/module/category.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Category';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified category module!';
|
||||
$_['text_edit'] = 'Edit Category Module';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify category module!';
|
27
extension/opencart/admin/language/en-gb/module/featured.php
Normal file
27
extension/opencart/admin/language/en-gb/module/featured.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Featured';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified featured module!';
|
||||
$_['text_edit'] = 'Edit Featured Module';
|
||||
$_['text_horizontal'] = 'Horizontal';
|
||||
$_['text_vertical'] = 'Vertical';
|
||||
|
||||
// Entry
|
||||
$_['entry_name'] = 'Module Name';
|
||||
$_['entry_product'] = 'Products';
|
||||
$_['entry_axis'] = 'Axis';
|
||||
$_['entry_width'] = 'Image Width';
|
||||
$_['entry_height'] = 'Image Height';
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Help
|
||||
$_['help_product'] = '(Autocomplete)';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify featured module!';
|
||||
$_['error_name'] = 'Module Name must be between 3 and 64 characters!';
|
||||
$_['error_width'] = 'Width required!';
|
||||
$_['error_height'] = 'Height required!';
|
14
extension/opencart/admin/language/en-gb/module/filter.php
Normal file
14
extension/opencart/admin/language/en-gb/module/filter.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Filter';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified filter module!';
|
||||
$_['text_edit'] = 'Edit Filter Module';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify filter module!';
|
18
extension/opencart/admin/language/en-gb/module/html.php
Normal file
18
extension/opencart/admin/language/en-gb/module/html.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'HTML Content';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified HTML Content module!';
|
||||
$_['text_edit'] = 'Edit HTML Content Module';
|
||||
|
||||
// Entry
|
||||
$_['entry_name'] = 'Module Name';
|
||||
$_['entry_title'] = 'Heading Title';
|
||||
$_['entry_description'] = 'Description';
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify HTML Content module!';
|
||||
$_['error_name'] = 'Module Name must be between 3 and 64 characters!';
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Information';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified information module!';
|
||||
$_['text_edit'] = 'Edit Information Module';
|
||||
|
||||
// Entry
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify information module!';
|
24
extension/opencart/admin/language/en-gb/module/latest.php
Normal file
24
extension/opencart/admin/language/en-gb/module/latest.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Latest';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified latest module!';
|
||||
$_['text_edit'] = 'Edit Latest Module';
|
||||
$_['text_horizontal'] = 'Horizontal';
|
||||
$_['text_vertical'] = 'Vertical';
|
||||
|
||||
// Entry
|
||||
$_['entry_name'] = 'Module Name';
|
||||
$_['entry_axis'] = 'Axis';
|
||||
$_['entry_limit'] = 'Limit';
|
||||
$_['entry_width'] = 'Image Width';
|
||||
$_['entry_height'] = 'Image Height';
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify latest module!';
|
||||
$_['error_name'] = 'Module Name must be between 3 and 64 characters!';
|
||||
$_['error_width'] = 'Width required!';
|
||||
$_['error_height'] = 'Height required!';
|
24
extension/opencart/admin/language/en-gb/module/special.php
Normal file
24
extension/opencart/admin/language/en-gb/module/special.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Specials';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified module specials!';
|
||||
$_['text_edit'] = 'Edit Specials Module';
|
||||
$_['text_horizontal'] = 'Horizontal';
|
||||
$_['text_vertical'] = 'Vertical';
|
||||
|
||||
// Entry
|
||||
$_['entry_name'] = 'Module Name';
|
||||
$_['entry_axis'] = 'Axis';
|
||||
$_['entry_limit'] = 'Limit';
|
||||
$_['entry_width'] = 'Image Width';
|
||||
$_['entry_height'] = 'Image Height';
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify specials module!';
|
||||
$_['error_name'] = 'Module Name must be between 3 and 64 characters!';
|
||||
$_['error_width'] = 'Width required!';
|
||||
$_['error_height'] = 'Height required!';
|
15
extension/opencart/admin/language/en-gb/module/store.php
Normal file
15
extension/opencart/admin/language/en-gb/module/store.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Store';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified store module!';
|
||||
$_['text_edit'] = 'Edit Store Module';
|
||||
|
||||
// Entry
|
||||
$_['entry_admin'] = 'Admin Users Only';
|
||||
$_['entry_status'] = 'Status';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify store module!';
|
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Bank Transfer';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified bank transfer details!';
|
||||
$_['text_edit'] = 'Edit Bank Transfer';
|
||||
|
||||
// Entry
|
||||
$_['entry_bank'] = 'Bank Transfer Instructions';
|
||||
$_['entry_order_status'] = 'Order Status';
|
||||
$_['entry_geo_zone'] = 'Geo Zone';
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify payment bank transfer!';
|
||||
$_['error_bank'] = 'Bank Transfer Instructions required!';
|
19
extension/opencart/admin/language/en-gb/payment/cheque.php
Normal file
19
extension/opencart/admin/language/en-gb/payment/cheque.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Cheque / Money Order';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified cheque / money order account details!';
|
||||
$_['text_edit'] = 'Edit Cheque / Money Order';
|
||||
|
||||
// Entry
|
||||
$_['entry_payable'] = 'Payable To';
|
||||
$_['entry_order_status'] = 'Order Status';
|
||||
$_['entry_geo_zone'] = 'Geo Zone';
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify payment cheque / money order!';
|
||||
$_['error_payable'] = 'Payable To required!';
|
17
extension/opencart/admin/language/en-gb/payment/cod.php
Normal file
17
extension/opencart/admin/language/en-gb/payment/cod.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Cash On Delivery';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified cash on delivery payment module!';
|
||||
$_['text_edit'] = 'Edit Cash On Delivery';
|
||||
|
||||
// Entry
|
||||
$_['entry_order_status'] = 'Order Status';
|
||||
$_['entry_geo_zone'] = 'Geo Zone';
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify payment cash on delivery!';
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Free Checkout';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_success'] = 'Success: You have modified free checkout payment module!';
|
||||
$_['text_edit'] = 'Edit Free Checkout';
|
||||
|
||||
// Entry
|
||||
$_['entry_order_status'] = 'Order Status';
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify payment free checkout!';
|
29
extension/opencart/admin/language/en-gb/report/customer.php
Normal file
29
extension/opencart/admin/language/en-gb/report/customer.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Customer Report';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_edit'] = 'Edit Customer Report';
|
||||
$_['text_success'] = 'Success: You have modified customers report!';
|
||||
$_['text_filter'] = 'Filter';
|
||||
$_['text_year'] = 'Years';
|
||||
$_['text_month'] = 'Months';
|
||||
$_['text_week'] = 'Weeks';
|
||||
$_['text_day'] = 'Days';
|
||||
$_['text_all_status'] = 'All Statuses';
|
||||
|
||||
// Column
|
||||
$_['column_date_start'] = 'Date Start';
|
||||
$_['column_date_end'] = 'Date End';
|
||||
$_['column_total'] = 'No. Customers';
|
||||
|
||||
// Entry
|
||||
$_['entry_date_start'] = 'Date Start';
|
||||
$_['entry_date_end'] = 'Date End';
|
||||
$_['entry_group'] = 'Group By';
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify customers report!';
|
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Customer Activity Report';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_edit'] = 'Edit Customer Activity Report';
|
||||
$_['text_success'] = 'Success: You have modified customer activity report!';
|
||||
$_['text_filter'] = 'Filter';
|
||||
$_['text_activity_register'] = '<a href="customer_id=%d">%s</a> registered for an account.';
|
||||
$_['text_activity_edit'] = '<a href="customer_id=%d">%s</a> updated their account details.';
|
||||
$_['text_activity_password'] = '<a href="customer_id=%d">%s</a> updated their account password.';
|
||||
$_['text_activity_reset'] = '<a href="customer_id=%d">%s</a> reset their account password.';
|
||||
$_['text_activity_login'] = '<a href="customer_id=%d">%s</a> logged in.';
|
||||
$_['text_activity_forgotten'] = '<a href="customer_id=%d">%s</a> requested a reset password.';
|
||||
$_['text_activity_address_add'] = '<a href="customer_id=%d">%s</a> added a new address.';
|
||||
$_['text_activity_address_edit'] = '<a href="customer_id=%d">%s</a> updated their address.';
|
||||
$_['text_activity_address_delete'] = '<a href="customer_id=%d">%s</a> deleted one of their addresses.';
|
||||
$_['text_activity_return_account'] = '<a href="customer_id=%d">%s</a> submitted a product return.';
|
||||
$_['text_activity_return_guest'] = '%s submitted a product return.';
|
||||
$_['text_activity_order_account'] = '<a href="customer_id=%d">%s</a> created a <a href="order_id=%d">new order</a>.';
|
||||
$_['text_activity_order_guest'] = '%s created a <a href="order_id=%d">new order</a>.';
|
||||
$_['text_activity_affiliate_add'] = '<a href="customer_id=%d">%s</a> registered for a affiliate account.';
|
||||
$_['text_activity_affiliate_edit'] = '<a href="customer_id=%d">%s</a> updated their affiliate details.';
|
||||
$_['text_activity_transaction'] = '<a href="customer_id=%d">%s</a> received commission from an new <a href="order_id=%d">order</a>.';
|
||||
|
||||
// Column
|
||||
$_['column_customer'] = 'Customer';
|
||||
$_['column_comment'] = 'Comment';
|
||||
$_['column_ip'] = 'IP';
|
||||
$_['column_date_added'] = 'Date Added';
|
||||
|
||||
// Entry
|
||||
$_['entry_customer'] = 'Customer';
|
||||
$_['entry_ip'] = 'IP';
|
||||
$_['entry_date_start'] = 'Date Start';
|
||||
$_['entry_date_end'] = 'Date End';
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify customer activity report!';
|
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
// Heading
|
||||
$_['heading_title'] = 'Customer Orders Report';
|
||||
|
||||
// Text
|
||||
$_['text_extension'] = 'Extensions';
|
||||
$_['text_edit'] = 'Edit Customer Orders Report';
|
||||
$_['text_success'] = 'Success: You have modified customer orders report!';
|
||||
$_['text_filter'] = 'Filter';
|
||||
$_['text_all_status'] = 'All Statuses';
|
||||
|
||||
// Column
|
||||
$_['column_customer'] = 'Customer Name';
|
||||
$_['column_email'] = 'E-Mail';
|
||||
$_['column_customer_group'] = 'Customer Group';
|
||||
$_['column_status'] = 'Status';
|
||||
$_['column_orders'] = 'No. Orders';
|
||||
$_['column_products'] = 'No. Products';
|
||||
$_['column_total'] = 'Total';
|
||||
$_['column_action'] = 'Action';
|
||||
|
||||
// Entry
|
||||
$_['entry_date_start'] = 'Date Start';
|
||||
$_['entry_date_end'] = 'Date End';
|
||||
$_['entry_customer'] = 'Customer';
|
||||
$_['entry_order_status'] = 'Order Status';
|
||||
$_['entry_status'] = 'Status';
|
||||
$_['entry_sort_order'] = 'Sort Order';
|
||||
|
||||
// Error
|
||||
$_['error_permission'] = 'Warning: You do not have permission to modify customer orders report!';
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user