Skip to content

Commit

Permalink
Fix issue with uninitialized eventData caused by 3.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jissereitsma committed Jun 27, 2023
1 parent d1cd0fb commit beefa9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 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.4.5] - 27 June 2023
### Fixed
- Fix issue with uninitialized `eventData` caused by 3.4.4

## [3.4.4] - 26 June 2023
### Fixed
- Fixed stepNavigator issue in non-default checkout
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.4.4",
"version": "3.4.5",
"license": "OSL-3.0",
"type": "magento2-module",
"homepage": "https://www.yireo.com/software/magento-extensions/googletagmanager2",
Expand Down
4 changes: 2 additions & 2 deletions view/frontend/web/js/mixins/step-navigator-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ define([

stepNavigator.steps.subscribe(function (steps) {
const firstStep = steps[0];
const eventData = window.YIREO_GOOGLETAGMANAGER2_BEGIN_CHECKOUT;

if (firstStep === undefined || firstStep == null || firstStep.length <= 0) {
logger('Error: No steps detected. Triggering event anyway :o')
pusher(eventData, 'push (page event "begin_checkout") [step-navigator-mixin.js]');
Expand All @@ -22,8 +24,6 @@ define([
return;
}

const eventData = window.YIREO_GOOGLETAGMANAGER2_BEGIN_CHECKOUT;

if (eventData === null || eventData === undefined) {
logger('skipped "begin_checkout" event because data is empty')
return;
Expand Down

0 comments on commit beefa9d

Please sign in to comment.