magma / magma2-cookie-restriction-fix
用于修复 Magento 2.1.x 版本中 Magento Cookie 限制错误的 Magento 模块
1.0.0
2017-09-08 09:51 UTC
Requires
- php: ~5.5.0|~5.6.0|~7.0.0
This package is not auto-updated.
Last update: 2024-09-18 21:14:12 UTC
README
为了符合欧盟的 Cookie 法规,我们必须启用 Magento Cookie 限制模式。
启用 Cookie 限制模式后,即使用户允许 cookies,Magento 2.1.x 版本也不会显示 Google Analytics 跟踪代码。
这是由于影响 magento 2.1.x 版本的错误 #5596 (magento/magento2#5596) 导致的。
此模块修复了该问题,并在用户同意的情况下启用 Google Analytics。
不仅 Magento Google Analytics 模块受益于此修复,而且使用标准 Magento 模块 Cookie 的任何模块也都将受益。
安装
安装模块
composer config repositories.magento2-cookie-restriction-fix git https://github.com/magma/magento2-cookie-restriction-fix.git composer require magma/magento2-cookie-restriction-fix
启用模块
./bin/magento setup:upgrade
Cookie 限制模式和第三方模块
为了符合 Cookie 法规,每个第三方模块都应该阻止跟踪 cookies,除非用户同意保存它们。
标准 Magento 模块 Cookie 限制模式旨在这样做。
第三方开发者可以通过检查模块 Magento_Cookie 提供的条件 isUserNotAllowSaveCookie
来使用此机制。
兼容性
在 Magento 2.1.8 上进行测试。它应该在更早的 Magento 2.1.x 版本上也能工作。