@@ -43,12 +43,13 @@ class CookieConsent extends Module
43
43
const CC_THEME = 'CC_THEME ' ;
44
44
const CC_GTM_CONSENT_MODE = 'CC_GTM_CONSENT_MODE ' ;
45
45
const CC_FB_CONSENT_MODE = 'CC_FB_CONSENT_MODE ' ;
46
+ const CC_ENABLE_FLOAT_PREFERENCES = 'CC_ENABLE_FLOAT_PREFERENCES ' ;
46
47
47
48
public function __construct ()
48
49
{
49
50
$ this ->name = 'cookieconsent ' ;
50
51
$ this ->tab = 'front_office_features ' ;
51
- $ this ->version = '1.0.2 ' ;
52
+ $ this ->version = '1.0.3 ' ;
52
53
$ this ->author = 'Novanta ' ;
53
54
$ this ->displayName = ('Cookie Consent ' );
54
55
$ this ->description = ('This module install cookie consent to manage user preferences with GTM Consent Mode compatibility ' );
@@ -78,6 +79,7 @@ public function install()
78
79
Configuration::updateValue (self ::CC_THEME , 'light ' );
79
80
Configuration::updateValue (self ::CC_GTM_CONSENT_MODE , false );
80
81
Configuration::updateValue (self ::CC_FB_CONSENT_MODE , false );
82
+ Configuration::updateValue (self ::CC_ENABLE_FLOAT_PREFERENCES , true );
81
83
82
84
return parent ::install () &&
83
85
$ this ->registerHook ('displayHeader ' ) &&
@@ -383,6 +385,25 @@ protected function getConfigForm()
383
385
)
384
386
),
385
387
),
388
+ array (
389
+ 'type ' => 'switch ' ,
390
+ 'label ' => $ this ->trans ('Enable float preferences button ' , [], 'Modules.Cookieconsent.Admin ' ),
391
+ 'name ' => self ::CC_ENABLE_FLOAT_PREFERENCES ,
392
+ 'is_bool ' => true ,
393
+ 'desc ' => $ this ->trans ('Enable float preferences button to handle user preferences ' , [], 'Modules.Cookieconsent.Admin ' ),
394
+ 'values ' => array (
395
+ array (
396
+ 'id ' => 'active_on ' ,
397
+ 'value ' => true ,
398
+ 'label ' => $ this ->trans ('Enabled ' , [], 'Modules.Cookieconsent.Admin ' )
399
+ ),
400
+ array (
401
+ 'id ' => 'active_off ' ,
402
+ 'value ' => false ,
403
+ 'label ' => $ this ->trans ('Disabled ' , [], 'Modules.Cookieconsent.Admin ' )
404
+ )
405
+ ),
406
+ ),
386
407
array (
387
408
'type ' => 'select ' ,
388
409
'label ' => $ this ->trans ('Theme ' , [], 'Modules.Cookieconsent.Admin ' ),
@@ -466,7 +487,8 @@ protected function getConfigFormValues()
466
487
self ::CC_DISPLAY_SECTION_SECURITY => Configuration::get (self ::CC_DISPLAY_SECTION_SECURITY , null , null , null , true ),
467
488
self ::CC_THEME => Configuration::get (self ::CC_THEME , null , null , null , true ),
468
489
self ::CC_GTM_CONSENT_MODE => Configuration::get (self ::CC_GTM_CONSENT_MODE , null , null , null , false ),
469
- self ::CC_FB_CONSENT_MODE => Configuration::get (self ::CC_FB_CONSENT_MODE , null , null , null , false )
490
+ self ::CC_FB_CONSENT_MODE => Configuration::get (self ::CC_FB_CONSENT_MODE , null , null , null , false ),
491
+ self ::CC_ENABLE_FLOAT_PREFERENCES => Configuration::get (self ::CC_ENABLE_FLOAT_PREFERENCES , null , null , null , true ),
470
492
);
471
493
}
472
494
@@ -636,6 +658,8 @@ public function hookdisplayHeader()
636
658
*/
637
659
public function hookDisplayFooter ()
638
660
{
639
- return $ this ->display (__FILE__ , "views/templates/front/hook/displayFooter.tpl " );
661
+ if (Configuration::get (self ::CC_ENABLE_FLOAT_PREFERENCES )) {
662
+ return $ this ->display (__FILE__ , "views/templates/front/hook/displayFooter.tpl " );
663
+ }
640
664
}
641
665
}
0 commit comments