-
Notifications
You must be signed in to change notification settings - Fork 9.3k
/
Copy pathnotices.phtml
48 lines (47 loc) · 2.09 KB
/
notices.phtml
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
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var \Magento\Cookie\Block\Html\Notices $block */
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
?>
<?php
/** @var \Magento\Cookie\Helper\Cookie $cookieHelper */
$cookieHelper = $block->getData('cookieHelper');
if ($cookieHelper->isCookieRestrictionModeEnabled()): ?>
<div role="alertdialog"
tabindex="-1"
class="message global cookie"
id="notice-cookie-block">
<div role="document" class="content" tabindex="0">
<p>
<strong><?= $block->escapeHtml(__('We use cookies to make your experience better.')) ?></strong>
<span><?= $block->escapeHtml(__(
'To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies.'
)) ?>
</span>
<?= $block->escapeHtml(__('<a href="%1">Learn more</a>.', $block->getPrivacyPolicyLink()), ['a']) ?>
</p>
<div class="actions">
<button id="btn-cookie-allow" class="action allow primary">
<span><?= $block->escapeHtml(__('Allow Cookies')) ?></span>
</button>
</div>
</div>
</div>
<?= /* @noEscape */ $secureRenderer->renderStyleAsTag("display: none;", 'div#notice-cookie-block') ?>
<script type="text/x-magento-init">
{
"#notice-cookie-block": {
"cookieNotices": {
"cookieAllowButtonSelector": "#btn-cookie-allow",
"cookieName": "<?= /* @noEscape */ \Magento\Cookie\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>",
"cookieValue": <?= /* @noEscape */ $cookieHelper->getAcceptedSaveCookiesWebsiteIds() ?>,
"cookieLifetime": <?= /* @noEscape */ $cookieHelper->getCookieRestrictionLifetime() ?>,
"noCookiesUrl": "<?= $block->escapeJs($block->getUrl('cookie/index/noCookies')) ?>"
}
}
}
</script>
<?php endif; ?>