From 17c24457fa1deac10e045d9ab5607b692aee6500 Mon Sep 17 00:00:00 2001 From: Alan Thai Date: Wed, 28 Feb 2024 13:17:04 -0500 Subject: [PATCH] fixes --- .../cartridge/client/default/js/account.js | 2 -- .../client/default/js/eventListenerRegistration.js | 6 ++---- .../cartridge/client/default/js/{signIn.js => login.js} | 0 .../cartridge/templates/default/checkout/boltEmbed.isml | 8 +++++--- .../cartridge/templates/default/account/login.isml | 1 - 5 files changed, 7 insertions(+), 10 deletions(-) rename cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/{signIn.js => login.js} (100%) diff --git a/cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/account.js b/cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/account.js index 272265e..37a7dd6 100644 --- a/cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/account.js +++ b/cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/account.js @@ -203,7 +203,6 @@ exports.setupListeners = async function () { }); Bolt.on('login_modal_closed', () => { - console.log('login modal closed'); var disabledAttr = $('.submit-customer').prop('disabled'); if (disabledAttr) { $('.submit-customer').removeAttr('disabled'); @@ -212,7 +211,6 @@ exports.setupListeners = async function () { Bolt.on('auto_account_check_complete', response => { const $accountCheckbox = $('#acct-checkbox'); - console.log('aaaa account check complete', response); if (response.result instanceof Error) { if (response.result.message === 'Invalid email') { $('.submit-customer').attr('disabled', 'true'); diff --git a/cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/eventListenerRegistration.js b/cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/eventListenerRegistration.js index 624837c..3c42a11 100644 --- a/cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/eventListenerRegistration.js +++ b/cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/eventListenerRegistration.js @@ -7,7 +7,7 @@ $(document).ready(async function () { $('.submit-customer').attr('disabled', 'true'); // mount on the div container otherwise the iframe won't render - const emailField = document.querySelector(window.BoltSelectors.checkoutEmailField).parentElement; + const emailField = document.querySelector(window.BoltSelectors.checkoutEmailField); if (emailField == null) { return; @@ -17,9 +17,7 @@ $(document).ready(async function () { const loginModalComponent = Bolt.getComponent('login_modal') || Bolt.create('login_modal'); - if (emailField != null) { - loginModalComponent.attach(emailField); - } + loginModalComponent.attach(emailField.parentElement); const isBoltShopperLoggedIn = $('.bolt-is-shopper-logged-in').val() === 'true'; const boltSFCCSessionLogoutCookie = account.getCookie('bolt_sfcc_session_logout'); diff --git a/cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/signIn.js b/cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/login.js similarity index 100% rename from cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/signIn.js rename to cartridges/int_bolt_embedded_sfra/cartridge/client/default/js/login.js diff --git a/cartridges/int_bolt_embedded_sfra/cartridge/templates/default/checkout/boltEmbed.isml b/cartridges/int_bolt_embedded_sfra/cartridge/templates/default/checkout/boltEmbed.isml index 7fd6feb..fbd93d7 100644 --- a/cartridges/int_bolt_embedded_sfra/cartridge/templates/default/checkout/boltEmbed.isml +++ b/cartridges/int_bolt_embedded_sfra/cartridge/templates/default/checkout/boltEmbed.isml @@ -17,16 +17,18 @@