Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer not identified after entering email address on shipping step #306

Open
milosreccode opened this issue Jul 2, 2024 · 0 comments

Comments

@milosreccode
Copy link

Environment details

PHP version: 8.1.13
Magento version: 2.4.6
Klaviyo extension version: 4.1.4

Steps to reproduce

  1. Add any product to cart
  2. Navigate to checkout
  3. Enter email address
  4. Unfocus email field by clicking outside it, this will trigger customer identification and quote update

Expected result

If customer is not already identified, it will be identified now by using email that customer entered in the email field.

Actual result

Custoomer is not identified because window.klaviyo.isIdentified() returns promise, but it is used as boolean in if statement.

Additional information

It seems that changing

if (!window.klaviyo.isIdentified()) {
  window.klaviyo.push(['identify', {
    '$email': self._email
  }]);
}

to

window.klaviyo.isIdentified().then((isIdentified) => {
  if (!isIdentified) {
    window.klaviyo.push(['identify', {
      '$email': self._email
    }]);
  }
});

is solution for this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants