Skip to content

Commit 5f995bb

Browse files
authored
Merge pull request #9 from IvoElgentos/dataLayer-fix-and-extra-config-checks
dataL fix and extra config checks in layout
2 parents e092a1d + 77f63ba commit 5f995bb

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/view/frontend/layout/default.xml

+10-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
<referenceBlock name="cookie_notices" remove="true" />
1414

1515
<referenceContainer name="after.body.start">
16-
<block class="Magento\Cookie\Block\Html\Notices" name="cookie_notices_content_mode_v2" template="Elgentos_ConsentModeV2::html/notices.phtml">
16+
<block class="Magento\Cookie\Block\Html\Notices"
17+
name="cookie_notices_content_mode_v2"
18+
template="Elgentos_ConsentModeV2::html/notices.phtml"
19+
ifconfig="elgentos_consentmodev2/general/enabled"
20+
>
1721
<block class="Magento\Cookie\Block\Html\Notices" name="cookie_banner_script" template="Elgentos_ConsentModeV2::cookie-banner-script.phtml" />
1822
<block class="Magento\Theme\Block\Html\Header\Logo" name="cookie_notice.logo">
1923
<arguments>
@@ -27,7 +31,11 @@
2731
</referenceContainer>
2832

2933
<referenceContainer name="before.body.end">
30-
<block name="cookie_notices_content_mode_v2_button" template="Elgentos_ConsentModeV2::html/button.phtml" />
34+
<block
35+
name="cookie_notices_content_mode_v2_button"
36+
template="Elgentos_ConsentModeV2::html/button.phtml"
37+
ifconfig="elgentos_consentmodev2/general/enabled"
38+
/>
3139
</referenceContainer>
3240
</body>
3341
</page>

src/view/frontend/templates/cookie-banner-script.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if (!$cookieHelper->isCookieRestrictionModeEnabled()) {
8080
};
8181
},
8282

83-
gtag(arguments) {
83+
gtag() {
8484
dataLayer.push(arguments);
8585
},
8686

0 commit comments

Comments
 (0)