klaviyo / magento2-klaviyo

37 stars 51 forks source link

Fix JS error on checkout page when Klaviyo module disabled #55

Closed ihor-sviziev closed 4 years ago

ihor-sviziev commented 4 years ago

When we disabled Klaviyo extension in the admin - we started getting following JS error on checkout page while editing email address field: image

I investigated this issue and found that there is no check if Klaviyo is available.

In addition to that - Klaviyo still saves email to quote, even when module is not enabled.

My PR checks if Klaviyo global variable (window._learnq) is not available - do not try to track or send requests about saving email to quote.