-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbacktotop.php
70 lines (60 loc) · 1.56 KB
/
backtotop.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
<?php
/**
* Back to Top Module Prestashop 1.7
* @author Jatniel Guzmán - https://jatnielguzman.com
* @copyright 2021
* @license MIT
*/
if (!defined('_PS_VERSION_')) {
exit;
}
class BackToTop extends Module
{
public function __construct()
{
$this->author = 'Jatniel Guzmán';
$this->name = 'backtotop';
$this->tab = 'Front';
$this->version = '1.0.0';
$this->need_instance = 0;
parent::__construct();
$this->displayName = $this->l('Back to Top Prestashop Module');
$this->description = $this->l('Back to Top - Scroll - Module Prestashop -Author: Jatniel Guzmán');
$this->ps_versions_compliancy = array('min' => '1.7.1', 'max' => _PS_VERSION_);
}
/**
* Installation du module
* @return boolean
*/
public function install()
{
return parent::install()
&& $this->registerHook('footer')
&& $this->registerHook('header');
}
/**
* Désinstallation du module
* @return boolean
*/
public function uninstall()
{
return parent::uninstall();
}
/**
* hookHeader
* @return boolean
*/
public function hookHeader()
{
$this->context->controller->addCSS($this->_path . 'views/css/backtotop.css');
$this->context->controller->addJS($this->_path . 'views/js/backtotop.js');
}
/**
* hookFooter
* @return boolean
*/
public function hookFooter()
{
return $this->display(__FILE__, 'views/templates/front/footer.tpl');
}
}