-
Notifications
You must be signed in to change notification settings - Fork 6
/
landing.php
47 lines (42 loc) · 1.29 KB
/
landing.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
<?php
/**
* NOTICE OF LICENSE
*
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
*
* You must not modify, adapt or create derivative works of this source code
*
* @author Doofinder
* @copyright Doofinder
* @license GPLv3
*/
$root_path = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
$config_file_path = $root_path . '/config/config.inc.php';
if (@file_exists($config_file_path)) {
require_once $config_file_path;
} else {
require_once dirname(__FILE__) . '/../../config/config.inc.php';
}
if (!defined('_PS_VERSION_')) {
exit;
}
if (Module::isInstalled('doofinder') && Module::isEnabled('doofinder')) {
$hashid = Tools::getValue('hashid');
$slug = Tools::getValue('slug');
if ($hashid && $slug) {
$module = Module::getInstanceByName('doofinder');
if ($id_lang = $module->getLanguageByHashid($hashid)) {
$link = Context::getContext()->link->getModuleLink(
$module->name,
'landing',
['landing_name' => $slug],
null,
$id_lang
);
Tools::redirect($link);
}
}
}
Tools::redirect('index.php?controller=404');