notices.phtml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /** @var \Magento\Cookie\Block\Html\Notices $block */
  8. ?>
  9. <?php if ($this->helper(\Magento\Cookie\Helper\Cookie::class)->isCookieRestrictionModeEnabled()): ?>
  10. <div role="alertdialog"
  11. tabindex="-1"
  12. class="message global cookie"
  13. id="notice-cookie-block"
  14. style="display: none;">
  15. <div role="document" class="content" tabindex="0">
  16. <p>
  17. <strong><?= $block->escapeHtml(__('We use cookies to make your experience better.')) ?></strong>
  18. <span><?= $block->escapeHtml(__('To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies.')) ?></span>
  19. <?= $block->escapeHtml(__('<a href="%1">Learn more</a>.', $block->getPrivacyPolicyLink()), ['a']) ?>
  20. </p>
  21. <div class="actions">
  22. <button id="btn-cookie-allow" class="action allow primary">
  23. <span><?= $block->escapeHtml(__('Allow Cookies')) ?></span>
  24. </button>
  25. </div>
  26. </div>
  27. </div>
  28. <script type="text/x-magento-init">
  29. {
  30. "#notice-cookie-block": {
  31. "cookieNotices": {
  32. "cookieAllowButtonSelector": "#btn-cookie-allow",
  33. "cookieName": "<?= /* @noEscape */ \Magento\Cookie\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>",
  34. "cookieValue": <?= /* @noEscape */ $this->helper(\Magento\Cookie\Helper\Cookie::class)->getAcceptedSaveCookiesWebsiteIds() ?>,
  35. "cookieLifetime": <?= /* @noEscape */ $this->helper(\Magento\Cookie\Helper\Cookie::class)->getCookieRestrictionLifetime() ?>,
  36. "noCookiesUrl": "<?= $block->escapeJs($block->escapeUrl($block->getUrl('cookie/index/noCookies'))) ?>"
  37. }
  38. }
  39. }
  40. </script>
  41. <?php endif; ?>