-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetadata.php
326 lines (290 loc) · 13.7 KB
/
metadata.php
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
<?php
$sMetadataVersion = '2.1';
// extension version:
$composerJson = file_get_contents(__DIR__. DIRECTORY_SEPARATOR.'composer.json');
$composerJson = str_replace("\\", "", $composerJson);
$composerArray = json_decode($composerJson,true);
$version = isset($composerArray['version']) ? $composerArray['version'] : '1.0.0';
$oxidVersion = new OxidEsales\Eshop\Core\ShopVersion();
$isOxid7 = version_compare($oxidVersion->getVersion(), "7.0.0") >= 0;
/**
* Module information
*/
$aModule = [
'version' => $version,
'id' => 'sxproductsearch',
'title' => 'Site Search 360',
'description' => [
'en' =>
'OXID module for integration and use of the Site Search 360.
<b style="color:#000;font-size: 15px;padding: 10px 0 10px 0;display: block;">Requirements</b>
<b style="display: block; margin: 0 0 5px 0">Cronjob</b>
The following cronjob is required for the initial product upload and product synchronization with the Site Search 360 backend.
<br/><br/>
Example: Crontab
<code style="background-color: #eee; display: block; padding: 5px">* * * * * wget quiet no-cache -O - [https://www.yourdomain.com]/index.php?cl=sxproductsearch_cron > /dev/null
</code>
Ideally, the execution should take place every minute, as shown in the example.
<b style="color:#000;font-size: 15px;padding: 10px 0 10px 0;display: block;">Important notes</b>
<b style="display: block; margin: 0 0 5px 0">Language configuration</b>
You need separate login data for Site Search 360 for each language. You can enter these in the module settings of this plugin.
After you make a change to the language configuration of your system (Menu <i>Master Settings</i> > <i>Languages</i>), e.g. adding a new language, it may be necessary to reinstall the module to enter the Site Search 360 access data for this language.
Your previous configuration <b>WONT</b> be lost during this process!
<br/><br/>
<b style="display: block; margin: 0 0 5px 0">Global configuration (<i>masterConfig.json</i>)</b>
Via the file <i>/export/semknox/masterConfigLANGUAGE.json</i>, while LANGUAGE has to be replaced with the Language shortcut (e.g. <i>masterConfigEn.json</i>), module settings can be globally overwritten <b>per language</b>. The values set there apply to <b>ALL active shops and languages</b> (in which the module is activated).
If the values <i>apiKey</i> and <i>projectId</i> are set in this file, all records are synchronized with only one account at Site Search 360. In this case, different values are realized via different <i>userGroups</i> (corresponds to the oxide <i>ShopIds</i>). The same applies to the search in the frontend.',
'de' =>
'OXID Modul zur Integration und Verwendung der Site Search 360.
<b style="color:#000;font-size: 15px;padding: 10px 0 10px 0;display: block;">Voraussetzungen</b>
<b style="display: block; margin: 0 0 5px 0">Cronjob</b>
Der folgende Cronjob wird für den initialen Produktupload und die Produktsynchronisation mit dem Site Search 360 Backend benötigt.
<br/><br/>
Beispiel: Crontab Eintrag
<code style="background-color: #eee; display: block; padding: 5px">* * * * * wget quiet no-cache -O - [https://www.yourdomain.com]/index.php?cl=sxproductsearch_cron > /dev/null</code>
Die Ausführung sollte idealerweise, wie im Beispiel gezeigt, jede Minute erfolgen.
<b style="color:#000;font-size: 15px;padding: 10px 0 10px 0;display: block;">Wichtige Hinweise</b>
<b style="display: block; margin: 0 0 5px 0">Sprachkonfiguration</b>
Sie benötigen für jede Sprache seperate Zugangsdaten für die Site Search 360. Diese können Sie unter den Moduleinstellungen dieses Plugins eingeben.
Nachdem Sie eine Veränderung an der Sprachkonfiguration ihres Systems (Menüpunkt <i>Stammdaten</i> > <i>Sprachen</i>) vornehmen (z.B. Hinzufügen einer neuen Sprache), kann es notwendig sein das Plugin erneut zu installieren, um die Site Search 360 Zugangsdaten für diese Sprache eingeben zu können.
Ihre bisherige Konfiguration geht bei diesem Vorgang <b>NICHT</b> verloren!
<br/><br/>
<b style="display: block; margin: 0 0 5px 0">Globale Konfiguration auf Dateiebene (<i>masterConfig.json</i>)</b>
Über die Datei <i>/export/semknox/masterConfigSPRACHE.json</i>, wobei SPRACHE mit dem Sprachkürzel der Sprache ersetzt werden muss (z.B. <i>masterConfigDe.json</i>), können Moduleinstellungen global <b>für jede Sprache</b> überschrieben werden. Die dort gesetzen Werte gelten für <b>ALLE aktiven Shops und Sprachen</b> (in denen das Modul aktiviert ist).
<br/>Werden in dieser Datei die Werte <i>apiKey</i> und <i>projectId</i> gesetzt, so werden die Datensätze mit nur einem einzigen Account bei Site Search 360 synchronisiert. Abweiche Werte werden in diesem Fall über verschieden <i>userGroups</i> (entspricht den Oxid <i>ShopIds</i>) realisiert. Gleiches gilt für die Suche im Frontend.'
],
'thumbnail' => 'logo.png',
'author' => 'Zoovu (Deutschland) GmbH',
'url' => 'https://www.sitesearch360.com',
'email' => 'oxid@sitesearch360.com',
'controllers' => [
'sxproductsearch_ajax' => Semknox\Productsearch\Application\Controller\Admin\AjaxController::class,
'sxproductsearch_cron' => Semknox\Productsearch\Application\Controller\CronController::class
],
'extend' => [
\OxidEsales\Eshop\Application\Model\Article::class => \Semknox\Productsearch\Application\Model\Article::class,
\OxidEsales\Eshop\Application\Model\ArticleList::class => \Semknox\Productsearch\Application\Model\ArticleList::class,
\OxidEsales\Eshop\Application\Model\Search::class => \Semknox\Productsearch\Application\Model\Search::class,
\OxidEsales\Eshop\Application\Controller\SearchController::class => \Semknox\Productsearch\Application\Controller\SearchController::class,
\OxidEsales\Eshop\Application\Controller\ArticleListController::class => \Semknox\Productsearch\Application\Controller\ArticleListController::class,
\OxidEsales\Eshop\Core\ViewConfig::class => \Semknox\Productsearch\Core\ViewConfig::class,
\OxidEsales\Eshop\Core\Language::class => \Semknox\Productsearch\Core\Language::class
],
'templates' => [
'admin_sxproductsearch_ajax.tpl' => 'semknox/semknox-oxid/Application/views/admin/tpl/admin_sxproductsearch_ajax.tpl',
'sxproductsearch_cron.tpl' => 'semknox/semknox-oxid/Application/views/tpl/sxproductsearch_cron.tpl',
],
'blocks' => [
/*
* BACKEND
*/
[
'template' => 'bottomnaviitem.tpl',
'block'=>'admin_bottomnavicustom',
'file'=>'Application/views/admin/blocks/admin_bottomnavicustom.tpl'
],
/*
* FRONTEND
*/
[
'template' => 'page/search/search.tpl',
'block' => 'search_header',
'file' => 'Application/views/blocks/header.tpl'
],
[
'template' => 'page/list/list.tpl',
'block' => 'page_list_listhead',
'file' => 'Application/views/blocks/header.tpl'
],
[
'template' => 'page/search/search.tpl',
'block' => 'search_top_listlocator',
'file' => 'Application/views/blocks/top_listlocator.tpl'
],
[
'template' => 'page/list/list.tpl',
'block' => 'page_list_upperlocator',
'file' => 'Application/views/blocks/top_listlocator.tpl'
],
[
'template' => 'layout/sidebar.tpl',
'block' => 'sidebar_categoriestree',
'file' => 'Application/views/blocks/sidebar_categoriestree.tpl'
],
[
'template' => 'widget/locator/attributes.tpl',
'block' => 'widget_locator_attributes',
'file' => 'Application/views/blocks/widget_locator_attributes.tpl'
],
[
'template' => 'widget/header/search.tpl',
'block' => 'widget_header_search_form',
'file' => 'Application/views/blocks/widget_header_search_form.tpl'
]
]
];
$settings = [];
$oxLanguage = new \OxidEsales\Eshop\Core\Language;
if(function_exists('oxNew')){
foreach ($oxLanguage->getLanguageArray() as $lang) {
$oxid = ucfirst($lang->oxid);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings'. $oxid,
'name' => 'sxProjectId' . $oxid,
'type' => 'str',
'value' => '',
'position' => 1
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxApiKey' . $oxid,
'type' => 'str',
'value' => '',
'position' => 2
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxIsSandbox' . $oxid,
'type' => 'bool',
'value' => 'false',
'position' => 3
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxFrontendActive' . $oxid,
'type' => 'bool',
'value' => 'true',
'position' => 4
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxUploadActive' . $oxid,
'type' => 'bool',
'value' => 'true',
'position' => 5
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxIncrementalUpdatesActive' . $oxid,
'type' => 'bool',
'value' => 'false',
'position' => 6
);
if(!$isOxid7){
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxAnswerActive' . $oxid,
'type' => 'bool',
'value' => 'true',
'position' => 7
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxFilterOptionCounterActive' . $oxid,
'type' => 'bool',
'value' => 'false',
'position' => 8
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxMoveFilterToSidebar' . $oxid,
'type' => 'bool',
'value' => 'false',
'position' => 9
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxHideRangeInRangeSliderTitle' . $oxid,
'type' => 'bool',
'value' => 'false',
'position' => 10
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxFilterGroupUnfoldCount' . $oxid,
'type' => 'str',
'value' => '5',
'position' => 13
);
}
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxCategoryQuery' . $oxid,
'type' => 'bool',
'value' => 'false',
'position' => 11
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxResultProduct' . $oxid,
'type' => 'select',
'value' => 'individualVariantProduct',
'constraints' => 'individualVariantProduct|parentProduct',
'position' => 12
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxSendInactiveArticles' . $oxid,
'type' => 'bool',
'value' => 'false',
'position' => 14
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxIgnoreOutOfStockArticles' . $oxid,
'type' => 'bool',
'value' => 'false',
'position' => 15
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings' . $oxid,
'name' => 'sxSeoUrlsActive' . $oxid,
'type' => 'bool',
'value' => 'false',
'position' => 16
);
$settings[] = array(
'group' => 'SemknoxProductsearchLanguageSettings'. $oxid,
'name' => 'sxRelevanceSortingTranslation' . $oxid,
'type' => 'str',
'value' => '',
'position' => 17
);
}
}
$settings[] = array(
'group' => 'SemknoxProductsearchSettings',
'name' => 'sxUploadBatchSize',
'type' => 'str',
'value' => '100',
'position' => 4
);
$settings[] = array(
'group' => 'SemknoxProductsearchSettings',
'name' => 'sxCollectBatchSize',
'type' => 'str',
'value' => '100',
'position' => 4
);
$settings[] = array(
'group' => 'SemknoxProductsearchSettings',
'name' => 'sxRequestTimeout',
'type' => 'str',
'value' => '15',
'position' => 5
);
$settings[] = array(
'group' => 'SemknoxProductsearchCronjob',
'name' => 'sxCronjobHour',
'type' => 'str',
'value' => rand(0,5),
'position' => 99
);
$settings[] = array(
'group' => 'SemknoxProductsearchCronjob',
'name' => 'sxCronjobMinute',
'type' => 'str',
'value' => rand(0, 59),
'position' => 100
);
$aModule['settings'] = $settings;