Skip to content

Commit 78e5c94

Browse files
author
Yuriy
committed
8200-google-tag-manager-extra
1 parent 9c76fcf commit 78e5c94

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Block/Adminhtml/System/Config/Form/EventList.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,14 @@ public function isPlusEnabled()
8888
{
8989
return (bool)$this->moduleManager->isEnabled('Magefan_GoogleTagManagerPlus');
9090
}
91+
92+
/**
93+
* Retrieve true if GTM Extra is enabled
94+
*
95+
* @return bool
96+
*/
97+
public function isExtraEnabled()
98+
{
99+
return (bool)$this->moduleManager->isEnabled('Magefan_GoogleTagManagerExtra');
100+
}
91101
}

view/adminhtml/templates/system/config/event/list.phtml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ $eventsPlus = [
2121
'Shipping Step on Checkout Page (add_shipping_info)',
2222
'Payments Step on Checkout Page (add_payment_info)'
2323
];
24+
$eventsExtra = [
25+
'Sign In (login)',
26+
'Create an Account (sign_up)',
27+
'Search (search)',
28+
'Earn Virtual Currency (earn_virtual_currency)',
29+
'Spend Virtual Currency (spend_virtual_currency)'
30+
];
2431
?>
2532
<br/>
2633
<div>
@@ -44,4 +51,19 @@ $eventsPlus = [
4451
</li>
4552
</ul>
4653
</div>
54+
<p <?php if (!$block->isExtraEnabled()) { ?>style="color: red"<?php } ?>>
55+
<strong>
56+
<?= $escaper->escapeHtml(__(!$block->isExtraEnabled() ? 'Available in GTM Extra Only' : 'GTM Extra')) ?>
57+
<?php if (!$block->isExtraEnabled()) { ?>
58+
(<a href="https://magefan.com/magento-2-google-tag-manager/pricing" target="_blank">Read More</a>):
59+
<?php } ?>
60+
</strong>
61+
</p>
62+
<div <?php if (!$block->isExtraEnabled()) { ?>style="opacity: 0.7; color: red"<?php } ?>>
63+
<ul>
64+
<li>
65+
<?= $escaper->escapeHtml(implode('</li><li>', $eventsExtra), ['li']) ?>
66+
</li>
67+
</ul>
68+
</div>
4769
</div>

0 commit comments

Comments
 (0)