From b8482f14f637119caaba32bdb647850b1e5da131 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 26 Nov 2024 09:59:25 +0100 Subject: [PATCH 1/4] resetting card selection when loaded so the UI will not get stuck --- .../views/frontend/tpl/stripecreditcard.tpl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Application/views/frontend/tpl/stripecreditcard.tpl b/Application/views/frontend/tpl/stripecreditcard.tpl index 8547bff..66cad56 100644 --- a/Application/views/frontend/tpl/stripecreditcard.tpl +++ b/Application/views/frontend/tpl/stripecreditcard.tpl @@ -116,9 +116,19 @@ //Activating card details form after load if stripe card is selected document.addEventListener('DOMContentLoaded', function() { - $('#payment_stripecreditcard').is(':checked') && !$('#payment_stripecreditcard').parents('dt').next('dd').is(':visible') ? - $('#payment_stripecreditcard').trigger('click') - : false; + const $stripeRadio = $('#payment_stripecreditcard'); + const $stripeCardDD = $stripeRadio.parents('dt').next('dd'); + const $stripeUsedCardSelect = $stripeCardDD.find('#stripe_used_card'); + + // Ensure Stripe credit card payment option is expanded if selected + if ($stripeRadio.is(':checked') && !$stripeCardDD.is(':visible')) { + $stripeRadio.trigger('click'); + } + + // Reset used card selection when Stripe is selected + if ($stripeRadio.is(':checked')) { + $stripeUsedCardSelect.prop('selectedIndex', 0); + } }); From 98a4082d683932741c028031a0867ec950b91047 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 26 Nov 2024 10:41:33 +0100 Subject: [PATCH 2/4] metadata update with 1.0.7-rc2 version --- metadata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.php b/metadata.php index f39b051..dfd1f66 100644 --- a/metadata.php +++ b/metadata.php @@ -57,7 +57,7 @@ 'en' => 'This module integrates STRIPE as payment provider in your OXID Shop.', ], 'thumbnail' => 'stripe_logo.png', - 'version' => '1.0.7', + 'version' => '1.0.7-rc2', 'author' => 'OXID eSales AG', 'url' => 'https://www.oxid-esales.com', 'email' => 'info@oxid-esales.com', From 0e086fe0e953a767962597b32d43058eb6dcf654 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Thu, 28 Nov 2024 09:38:56 +0100 Subject: [PATCH 3/4] Card selection UI stuck when history back option is used, dirty fix --- .../views/frontend/tpl/stripecreditcard.tpl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Application/views/frontend/tpl/stripecreditcard.tpl b/Application/views/frontend/tpl/stripecreditcard.tpl index 66cad56..9de3ea9 100644 --- a/Application/views/frontend/tpl/stripecreditcard.tpl +++ b/Application/views/frontend/tpl/stripecreditcard.tpl @@ -125,10 +125,18 @@ $stripeRadio.trigger('click'); } - // Reset used card selection when Stripe is selected - if ($stripeRadio.is(':checked')) { - $stripeUsedCardSelect.prop('selectedIndex', 0); - } + //this is a dirty fix for selecting firs card selection element so the card UI not stuck when customer + // uses the browsers history back + setTimeout(function (){ + const $stripeCardDD = $stripeRadio.parents('dt').next('dd'); + const $stripeUsedCardSelect = $stripeCardDD.find('#stripe_used_card'); + + // Reset used card selection when Stripe is selected + if ($stripeRadio.is(':checked')) { + $stripeUsedCardSelect.prop('selectedIndex', 0); + } + + }, 200); }); From e80a8230cac60117ac0fbdfb54e1092f7eb035ac Mon Sep 17 00:00:00 2001 From: Mario Lorenz Date: Thu, 28 Nov 2024 11:25:02 +0100 Subject: [PATCH 4/4] remove redundant code --- Application/views/frontend/tpl/stripecreditcard.tpl | 3 --- 1 file changed, 3 deletions(-) diff --git a/Application/views/frontend/tpl/stripecreditcard.tpl b/Application/views/frontend/tpl/stripecreditcard.tpl index 9de3ea9..66cd120 100644 --- a/Application/views/frontend/tpl/stripecreditcard.tpl +++ b/Application/views/frontend/tpl/stripecreditcard.tpl @@ -128,9 +128,6 @@ //this is a dirty fix for selecting firs card selection element so the card UI not stuck when customer // uses the browsers history back setTimeout(function (){ - const $stripeCardDD = $stripeRadio.parents('dt').next('dd'); - const $stripeUsedCardSelect = $stripeCardDD.find('#stripe_used_card'); - // Reset used card selection when Stripe is selected if ($stripeRadio.is(':checked')) { $stripeUsedCardSelect.prop('selectedIndex', 0);