Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/opencart/opencart
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkerr committed May 11, 2024
2 parents a509abd + c8fc26d commit 2428bcf
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 16 deletions.
2 changes: 1 addition & 1 deletion upload/admin/controller/catalog/attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ public function autocomplete(): void {
$filter_data = [
'filter_name' => $this->request->get['filter_name'],
'start' => 0,
'limit' => 5
'limit' => $this->config->get('config_autocomplete_limit')
];

$results = $this->model_catalog_attribute->getAttributes($filter_data);
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/catalog/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ public function autocomplete(): void {
'sort' => 'name',
'order' => 'ASC',
'start' => 0,
'limit' => 5
'limit' => $this->config->get('config_autocomplete_limit')
];

$results = $this->model_catalog_category->getCategories($filter_data);
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/catalog/download.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ public function autocomplete(): void {
$filter_data = [
'filter_name' => $this->request->get['filter_name'],
'start' => 0,
'limit' => 5
'limit' => $this->config->get('config_autocomplete_limit')
];

$results = $this->model_catalog_download->getDownloads($filter_data);
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/catalog/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ public function autocomplete(): void {
$filter_data = [
'filter_name' => $this->request->get['filter_name'] . '%',
'start' => 0,
'limit' => 5
'limit' => $this->config->get('config_autocomplete_limit')
];

$this->load->model('catalog/filter');
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/catalog/filter_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public function autocomplete(): void {
$filter_data = [
'filter_name' => $this->request->get['filter_name'] . '%',
'start' => 0,
'limit' => 5
'limit' => $this->config->get('config_autocomplete_limit')
];

$this->load->model('catalog/filter_group');
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/catalog/manufacturer.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public function autocomplete(): void {
$filter_data = [
'filter_name' => $this->request->get['filter_name'],
'start' => 0,
'limit' => 5
'limit' => $this->config->get('config_autocomplete_limit')
];

$results = $this->model_catalog_manufacturer->getManufacturers($filter_data);
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/catalog/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public function autocomplete(): void {
$filter_data = [
'filter_name' => $this->request->get['filter_name'],
'start' => 0,
'limit' => 5
'limit' => $this->config->get('config_autocomplete_limit')
];

$options = $this->model_catalog_option->getOptions($filter_data);
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/catalog/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ public function autocomplete(): void {
if (isset($this->request->get['limit'])) {
$limit = (int)$this->request->get['limit'];
} else {
$limit = 5;
$limit = $this->config->get('config_autocomplete_limit');
}

$filter_data = [
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/customer/customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ public function autocomplete(): void {
'filter_name' => $filter_name,
'filter_email' => $filter_email,
'start' => 0,
'limit' => 5
'limit' => $this->config->get('config_autocomplete_limit')
];

$this->load->model('customer/customer');
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/marketing/affiliate.php
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ public function autocomplete(): void {
'filter_name' => $filter_name,
'filter_email' => $filter_email,
'start' => 0,
'limit' => 5
'limit' => $this->config->get('config_autocomplete_limit')
];

$this->load->model('marketing/affiliate');
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/marketing/marketing.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ public function autocomplete(): void {
'filter_name' => $filter_name,
'filter_code' => $filter_code,
'start' => 0,
'limit' => 5
'limit' => $this->config->get('config_autocomplete_limit')
];

$this->load->model('marketing/marketing');
Expand Down
5 changes: 5 additions & 0 deletions upload/admin/controller/setting/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public function index(): void {
$data['config_pagination'] = $this->config->get('config_pagination');
$data['config_product_count'] = $this->config->get('config_product_count');
$data['config_pagination_admin'] = $this->config->get('config_pagination_admin');
$data['config_autocomplete_limit'] = $this->config->get('config_autocomplete_limit');
$data['config_product_report_status'] = $this->config->get('config_product_report_status');

// Review
Expand Down Expand Up @@ -503,6 +504,10 @@ public function save(): void {
$json['error']['pagination_admin'] = $this->language->get('error_pagination');
}

if (!$this->request->post['config_autocomplete_limit']) {
$json['error']['autocomplete_limit'] = $this->language->get('error_autocomplete_limit');
}

if (!$this->request->post['config_article_description_length']) {
$json['error']['article_description_length'] = $this->language->get('error_article_description_length');
}
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/controller/startup/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function index(): void {
date_default_timezone_set($this->config->get('config_timezone'));

// Sync PHP and DB time zones.
$this->db->query("SET time_zone = '" . $this->db->escape(date('P')) . "'");
$this->db->query("SET `time_zone` = '" . $this->db->escape(date('P')) . "'");
}

// Response output compression level
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/language/en-gb/setting/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
$_['help_currency_auto'] = 'Set your store to automatically update currencies daily.';
$_['help_product_description_length'] = 'In the list view, short description character limit (categories, special etc)';
$_['help_pagination'] = 'Determines how many catalog items are shown per page (products, categories, etc)';
$_['help_autocomplete_limit'] = 'Determines how many lines are shown per autocomplte entry (filters, products, categories, etc)';
$_['help_autocomplete_limit'] = 'Determines how many lines are shown per autocomplete entry (filters, products, categories, etc)';
$_['help_product_count'] = 'Show the number of products inside the subcategories in the storefront header category menu. Be warned, this will cause an extreme performance hit for stores with a lot of subcategories!';
$_['help_product_category'] = 'Display products in each parent category.';
$_['help_product_report'] = 'Report how many times a product is viewed. This can use up a lot of storage on high traffic sites.';
Expand Down
4 changes: 2 additions & 2 deletions upload/admin/model/catalog/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ public function getProducts(array $data = []): array {
}

if (!empty($data['filter_price'])) {
$sql .= " AND `p`.`price` LIKE '" . (float)$data['filter_price'] . "'";
$sql .= " AND `p`.`price` LIKE '" . (float)$data['filter_price'] . '%' . "'";
}

if (isset($data['filter_quantity']) && $data['filter_quantity'] !== '') {
Expand Down Expand Up @@ -961,7 +961,7 @@ public function getTotalProducts(array $data = []): int {
}

if (isset($data['filter_price']) && $data['filter_price'] !== '') {
$sql .= " AND `p`.`price` LIKE '" . (float)$data['filter_price'] . "'";
$sql .= " AND `p`.`price` LIKE '" . (float)$data['filter_price'] . '%' . "'";
}

if (isset($data['filter_quantity']) && $data['filter_quantity'] !== '') {
Expand Down
2 changes: 1 addition & 1 deletion upload/catalog/controller/startup/setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function index(): void {
date_default_timezone_set($this->config->get('config_timezone'));

// Sync PHP and DB time zones.
$this->db->query("SET time_zone = '" . $this->db->escape(date('P')) . "'");
$this->db->query("SET `time_zone` = '" . $this->db->escape(date('P')) . "'");
}

// Response output compression level
Expand Down
6 changes: 6 additions & 0 deletions upload/system/library/session/db.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
* @package Opencart\System\Library\Session
*/
class DB {
/**
* @var object
*/
private object $db;
/**
* @var object
*/
private object $config;

/**
Expand Down
3 changes: 3 additions & 0 deletions upload/system/library/session/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* @package Opencart\System\Library\Session
*/
class File {
/**
* @var object
*/
private object $config;

/**
Expand Down

0 comments on commit 2428bcf

Please sign in to comment.