Skip to content

Commit 2dca99a

Browse files
committed
updates email.js to correctly handle the klaviyo object promise
1 parent 6d16788 commit 2dca99a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
#### Fixed
1111
- Fixed Deprecated use of base64_encode in Observer/SalesQuoteSaveAfter.php
12+
- Fixed profile identification on checkout page
1213

1314
### [4.2.0] - 2024-09-17
1415

view/frontend/web/js/view/checkout/email.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,14 @@ define([
4545
}
4646

4747
self._email = jQuery(this).val();
48-
if (!window.klaviyo.isIdentified()) {
49-
window.klaviyo.push(['identify', {
50-
'$email': self._email
51-
}]);
52-
}
48+
49+
window.klaviyo.isIdentified().then((identified)=> {
50+
if (!identified) {
51+
window.klaviyo.identify({
52+
'$email': self._email
53+
});
54+
}
55+
})
5356
self.postUserEmail(self._email);
5457
});
5558
},

0 commit comments

Comments
 (0)