Skip to content

Commit

Permalink
Livewire: Multiple root elements detected
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Dec 15, 2023
1 parent 5fdf8f4 commit 77c811a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.7.3] - 15 December 2023
### Fixed
- Livewire: Multiple root elements detected

## [3.7.2] - 13 December 2023
### Fixed
- Improve loading of shipping method (so `add_shipping_info` event)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yireo/magento2-googletagmanager2",
"version": "3.7.2",
"version": "3.7.3",
"license": "OSL-3.0",
"type": "magento2-module",
"homepage": "https://www.yireo.com/software/magento-extensions/googletagmanager2",
Expand Down
35 changes: 18 additions & 17 deletions view/frontend/templates/hyva_checkout/data-layer.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@ use Yireo\GoogleTagManager2\DataLayer\Event\BeginCheckout;

$beginCheckoutEvent = $block->getData('begin_checkout_event');
?>
<script>
function triggerEvent(event) {
yireoGoogleTagManager2Pusher(event.detail);
}
<div>
<script>
function triggerEvent(event) {
yireoGoogleTagManager2Pusher(event.detail);
}

function initYireoGoogleTagManager() {
"use strict";
function initYireoGoogleTagManager() {
"use strict";

triggerEvent(new CustomEvent('ga:trigger-event', {detail:<?= json_encode($beginCheckoutEvent->get()) ?>}));
triggerEvent(new CustomEvent('ga:trigger-event', {detail: <?= json_encode($beginCheckoutEvent->get()) ?>}));

return {
triggerEvent
return {
triggerEvent
}
}
}
</script>
<div id="ga-trigger"
x-data="initYireoGoogleTagManager()"
class="hidden"
@ga:trigger-event.window="triggerEvent($event)"
></div>

</script>
<div id="ga-trigger"
x-data="initYireoGoogleTagManager()"
class="hidden"
@ga:trigger-event.window="triggerEvent($event)"
></div>
</div>

0 comments on commit 77c811a

Please sign in to comment.