-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpatch
More file actions
162 lines (153 loc) · 6.32 KB
/
Copy pathpatch
File metadata and controls
162 lines (153 loc) · 6.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
diff --git a/upload/admin/controller/catalog/filter.php b/upload/admin/controller/catalog/filter.php
index 02d39d4..f0f2497 100644
--- a/upload/admin/controller/catalog/filter.php
+++ b/upload/admin/controller/catalog/filter.php
@@ -381,10 +381,6 @@ class ControllerCatalogFilter extends Controller {
}
}
- if (($this->request->post['type'] == 'select' || $this->request->post['type'] == 'radio' || $this->request->post['type'] == 'checkbox') && !isset($this->request->post['filter_value'])) {
- $this->error['warning'] = $this->language->get('error_type');
- }
-
if (isset($this->request->post['filter_value'])) {
foreach ($this->request->post['filter_value'] as $filter_value_id => $filter_value) {
foreach ($filter_value['filter_value_description'] as $language_id => $filter_value_description) {
diff --git a/upload/admin/model/localisation/language.php b/upload/admin/model/localisation/language.php
index ab05508..50a97ff 100644
--- a/upload/admin/model/localisation/language.php
+++ b/upload/admin/model/localisation/language.php
@@ -56,7 +56,20 @@ class ModelLocalisationLanguage extends Model {
foreach ($query->rows as $download) {
$this->db->query("INSERT INTO " . DB_PREFIX . "download_description SET download_id = '" . (int)$download['download_id'] . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($download['name']) . "'");
}
-
+
+ // Filter
+ $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "filter_description WHERE language_id = '" . (int)$this->config->get('config_language_id') . "'");
+
+ foreach ($query->rows as $filter) {
+ $this->db->query("INSERT INTO " . DB_PREFIX . "filter_description SET filter_id = '" . (int)$filter['filter_id'] . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($filter['name']) . "'");
+ }
+
+ $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "filter_value_description WHERE language_id = '" . (int)$this->config->get('config_language_id') . "'");
+
+ foreach ($query->rows as $filter_value) {
+ $this->db->query("INSERT INTO " . DB_PREFIX . "filter_value_description SET filter_value_id = '" . (int)$filter_value['filter_value_id'] . "', language_id = '" . (int)$language_id . "'filter_id = '" . (int)$filter_value['filter_id'] . "', , name = '" . $this->db->escape($filter_value['name']) . "'");
+ }
+
// Information
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "information_description WHERE language_id = '" . (int)$this->config->get('config_language_id') . "'");
@@ -183,6 +196,8 @@ class ModelLocalisationLanguage extends Model {
$this->db->query("DELETE FROM " . DB_PREFIX . "customer_group_description WHERE language_id = '" . (int)$language_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "download_description WHERE language_id = '" . (int)$language_id . "'");
+ $this->db->query("DELETE FROM " . DB_PREFIX . "filter_description WHERE language_id = '" . (int)$language_id . "'");
+ $this->db->query("DELETE FROM " . DB_PREFIX . "filter_value_description WHERE language_id = '" . (int)$language_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "information_description WHERE language_id = '" . (int)$language_id . "'");
$this->cache->delete('information');
diff --git a/upload/image/cache/.gitignore b/upload/image/cache/.gitignore
deleted file mode 100644
index e69de29..0000000
diff --git a/upload/image/cache/data/.gitignore b/upload/image/cache/data/.gitignore
deleted file mode 100644
index e69de29..0000000
diff --git a/upload/install/opencart.sql b/upload/install/opencart.sql
index cb7039f..80e33fb 100644
--- a/upload/install/opencart.sql
+++ b/upload/install/opencart.sql
@@ -1091,6 +1091,77 @@ CREATE TABLE `oc_download_description` (
-- Dumping data for table `oc_download_description`
--
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `oc_filter`
+--
+
+DROP TABLE IF EXISTS `oc_filter`;
+CREATE TABLE `oc_filter` (
+ `filter_id` int(11) NOT NULL AUTO_INCREMENT,
+ `sort_order` int(3) NOT NULL,
+ PRIMARY KEY (`filter_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+--
+-- Dumping data for table `oc_filter`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `oc_filter_description`
+--
+
+DROP TABLE IF EXISTS `oc_filter_description`;
+CREATE TABLE `oc_filter_description` (
+ `filter_id` int(11) NOT NULL,
+ `language_id` int(11) NOT NULL,
+ `name` varchar(64) COLLATE utf8_bin NOT NULL,
+ PRIMARY KEY (`filter_id`,`language_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+--
+-- Dumping data for table `oc_filter_description`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `oc_filter_value`
+--
+
+DROP TABLE IF EXISTS `oc_filter_value`;
+CREATE TABLE `oc_filter_value` (
+ `filter_value_id` int(11) NOT NULL AUTO_INCREMENT,
+ `filter_id` int(11) NOT NULL,
+ `sort_order` int(3) NOT NULL,
+ PRIMARY KEY (`filter_value_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+--
+-- Dumping data for table `oc_filter_value`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `oc_filter_value_description`
+--
+
+DROP TABLE IF EXISTS `oc_filter_value_description`;
+CREATE TABLE `oc_filter_value_description` (
+ `filter_value_id` int(11) NOT NULL,
+ `language_id` int(11) NOT NULL,
+ `filter_id` int(11) NOT NULL,
+ `name` varchar(64) COLLATE utf8_bin NOT NULL,
+ PRIMARY KEY (`filter_value_id`,`language_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+--
+-- Dumping data for table `oc_filter_value_description`
+--
-- --------------------------------------------------------
@@ -2044,6 +2115,23 @@ INSERT INTO `oc_product_discount` (`product_discount_id`, `product_id`, `custome
-- --------------------------------------------------------
--
+-- Table structure for table `oc_product_filter`
+--
+
+DROP TABLE IF EXISTS `oc_product_filter`;
+CREATE TABLE `oc_product_filter` (
+ `product_id` int(11) NOT NULL,
+ `filter_value_id` int(11) NOT NULL,
+ PRIMARY KEY (`product_id`,`filter_value_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+--
+-- Dumping data for table `oc_product_filter`
+--
+
+-- --------------------------------------------------------
+
+--
-- Table structure for table `oc_product_image`
--