Skip to content

Commit 6ac997d

Browse files
authored
Merge pull request #3 from yuriyhamulevych/8200-google-tag-manager-extra
8200-google-tag-manager-extra
2 parents 309a435 + 78e5c94 commit 6ac997d

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
@@ -85,4 +85,14 @@ public function isPlusEnabled()
8585
{
8686
return (bool)$this->moduleManager->isEnabled('Magefan_GoogleTagManagerPlus');
8787
}
88+
89+
/**
90+
* Retrieve true if GTM Extra is enabled
91+
*
92+
* @return bool
93+
*/
94+
public function isExtraEnabled()
95+
{
96+
return (bool)$this->moduleManager->isEnabled('Magefan_GoogleTagManagerExtra');
97+
}
8898
}

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ $eventsPlus = [
2727
'Shipping Step on Checkout Page (add_shipping_info)',
2828
'Payments Step on Checkout Page (add_payment_info)'
2929
];
30+
$eventsExtra = [
31+
'Sign In (login)',
32+
'Create an Account (sign_up)',
33+
'Search (search)',
34+
'Earn Virtual Currency (earn_virtual_currency)',
35+
'Spend Virtual Currency (spend_virtual_currency)'
36+
];
3037
?>
3138
<br/>
3239
<div>
@@ -50,4 +57,19 @@ $eventsPlus = [
5057
</li>
5158
</ul>
5259
</div>
60+
<p <?php if (!$block->isExtraEnabled()) { ?>style="color: red"<?php } ?>>
61+
<strong>
62+
<?= $escaper->escapeHtml(__(!$block->isExtraEnabled() ? 'Available in GTM Extra Only' : 'GTM Extra')) ?>
63+
<?php if (!$block->isExtraEnabled()) { ?>
64+
(<a href="https://magefan.com/magento-2-google-tag-manager/pricing" target="_blank">Read More</a>):
65+
<?php } ?>
66+
</strong>
67+
</p>
68+
<div <?php if (!$block->isExtraEnabled()) { ?>style="opacity: 0.7; color: red"<?php } ?>>
69+
<ul>
70+
<li>
71+
<?= $escaper->escapeHtml(implode('</li><li>', $eventsExtra), ['li']) ?>
72+
</li>
73+
</ul>
74+
</div>
5375
</div>

0 commit comments

Comments
 (0)