-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't install the module on prestashop #1
Comments
I installed it, simply download zip source code, unpack, rename to eucookiesmart and copy to modules folder, Unfortunately looks that module is not working, |
Hi guys, probably something has changed in prestashop or there's some incompatibility between your theme and the module. I'll check it for new prestashop versions. Do you use any third party theme? Does you have any error in the browser console referring to the module JavaScript code? Thanks. |
Hello,
I have custom theme but without problems with all modules, |
I @samoa i've tested with 1.7.8.2 with a clean install and i have no problems whatsoever, i think it's due to the theme. If the console has no object it's due to the fact that the theme does not render HookDisplayFooter, you can try to change: public function hookDisplayHeader()
{
$this->context->controller->addJS($this->_path . 'views/js/euCookieSmart.js');
$cssFile = Configuration::get("EUCOOKIESMART_STYLE");
$this->context->controller->addCSS($this->_path . 'views/css/styles/' . ($cssFile ? $cssFile : 'default.css'));
} with: public function hookDisplayHeader()
{
$this->context->controller->addJS($this->_path . 'views/js/euCookieSmart.js');
$cssFile = Configuration::get("EUCOOKIESMART_STYLE");
$this->context->controller->addCSS($this->_path . 'views/css/styles/' . ($cssFile ? $cssFile : 'default.css'));
return $this->HookDisplayFooter(); // this line is new
} should be enough to render the template that includes the configuration object. the best way is to comment HookDisplayFooter code and copy it to the hookDisplayHeader method, this is safer if you change the theme to something that renders the footer or it will render twice. If the configuration object is present than it migth be a problem of the loading order (document is initialized but the footer has not rendered yet), maybe the same solution above can apply for your theme. @webdonchi the zip source of the github repository breaks the structure of Prestashop modules. to use the zip just unpack it, rename the inner directory to eucookiesmart and compress that inner folder. This new zip will work. |
@samoa yup there's a bug there. The euCookieSmart.tpl was not passing the decline button enable switch correctly. Use the latest release or simply replace: <script>
var euCookieSmartConfig = {
message: "{$cookieMsg}",
acceptButton: "{$EUCOOKIESMART_BUTTON_ACCEPT}",
acceptText: "{$cookieAcceptText|escape:"quotes"}",
declineButton: false,
declineText: "{$cookieDeclineText}",
policyButton: "{$EUCOOKIESMART_BUTTON_POLICY}",
policyText: "{$cookiePolicyText|escape:"quotes"}",
policyURL: "{$policyCMSlink}",
acceptOnContinue: "{$EUCOOKIESMART_ACCEPT_CONTINUE}",
expireDays: "{$EUCOOKIESMART_EXPIRE_DAYS|escape:"quotes"}",
renewOnVisit: "{$EUCOOKIESMART_RENEW_VISIT}",
effect: "{$EUCOOKIESMART_EFFECT|escape:"quotes"}",
fixed: "{$EUCOOKIESMART_FIXED|boolval}",
bottom: "{$EUCOOKIESMART_BOTTOM}"
};
</script> with : <script>
var euCookieSmartConfig = {
message: "{$cookieMsg}",
acceptButton: "{$EUCOOKIESMART_BUTTON_ACCEPT}",
acceptText: "{$cookieAcceptText|escape:"quotes"}",
declineButton: {$EUCOOKIESMART_BUTTON_DECLINE},
declineText: "{$cookieDeclineText}",
policyButton: "{$EUCOOKIESMART_BUTTON_POLICY}",
policyText: "{$cookiePolicyText|escape:"quotes"}",
policyURL: "{$policyCMSlink}",
acceptOnContinue: "{$EUCOOKIESMART_ACCEPT_CONTINUE}",
expireDays: "{$EUCOOKIESMART_EXPIRE_DAYS|escape:"quotes"}",
renewOnVisit: "{$EUCOOKIESMART_RENEW_VISIT}",
effect: "{$EUCOOKIESMART_EFFECT|escape:"quotes"}",
fixed: "{$EUCOOKIESMART_FIXED|boolval}",
bottom: "{$EUCOOKIESMART_BOTTOM}"
};
</script> in euCookieSmart.tpl file. |
Now button is displayed, Or should it disable another one cookies? As I understood EU regulations it looks like cookies for google analytics are also not allowed without agreement. By the way I renamed in eucookiesmart.js variable eucookiesmrt to eucookiesmart (a letter was missing), |
@samoa that cookie index name doesn't change it's behavhiour. You can for instance prevent each module that set cookies to "act" only when the cookie has a value allowed and not declined. When you decline the cookie, the eucookiesmart cookie will be valued as declined only. Unfortunately you need to handle each provider within the provider code (for instance by wrapping their function or use script tag attributes), so modules that prevent all cookies usually hooks into many sdk's. (google analytics, facebook etc) |
hi, yes the error is with my theme...infact with a clean installation it seems work, thank you! |
hi, on ps 1.7.6.7 i can't install your module with the method "add a module", can you check please?
The text was updated successfully, but these errors were encountered: