From 5d92fe50f2284b1a93efe2f387a092ca9d635372 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 22 Apr 2025 12:56:19 +0530 Subject: [PATCH] optmized the code changes --- modules/bankwire/views/js/front/payment.js | 12 ++++++++---- .../views/templates/front/payment_execution.tpl | 2 +- modules/cheque/views/js/front/payment.js | 11 +++++++---- .../views/templates/front/payment_execution.tpl | 2 +- .../views/templates/front/payment_execution.tpl | 2 +- .../views/templates/front/payment_execution.tpl | 2 +- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/modules/bankwire/views/js/front/payment.js b/modules/bankwire/views/js/front/payment.js index 7f6b0902e..c9784132d 100644 --- a/modules/bankwire/views/js/front/payment.js +++ b/modules/bankwire/views/js/front/payment.js @@ -20,7 +20,11 @@ * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 */ -function disableSubmitButton(button) { - $(button).attr('disabled', 'disabled'); - $(button).closest('form').get(0).submit(); -} \ No newline at end of file + +$(document).ready(function () { + $(document).on('click', '.confirm_order', function(e){ + e.preventDefault(); + $(e.target).attr('disabled', 'disabled'); + $(e.target).closest('form').get(0).submit(); + }); +}); diff --git a/modules/bankwire/views/templates/front/payment_execution.tpl b/modules/bankwire/views/templates/front/payment_execution.tpl index 148c11978..835542afe 100644 --- a/modules/bankwire/views/templates/front/payment_execution.tpl +++ b/modules/bankwire/views/templates/front/payment_execution.tpl @@ -90,7 +90,7 @@ {*By webkul To Check Order restrict condition before Payment by the customer*} {if !$restrict_order} - {/if} diff --git a/modules/cheque/views/js/front/payment.js b/modules/cheque/views/js/front/payment.js index 7f6b0902e..698fe1a0f 100644 --- a/modules/cheque/views/js/front/payment.js +++ b/modules/cheque/views/js/front/payment.js @@ -20,7 +20,10 @@ * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 */ -function disableSubmitButton(button) { - $(button).attr('disabled', 'disabled'); - $(button).closest('form').get(0).submit(); -} \ No newline at end of file +$(document).ready(function () { + $(document).on('click', '.confirm_order', function(e){ + e.preventDefault(); + $(e.target).attr('disabled', 'disabled'); + $(e.target).closest('form').get(0).submit(); + }); +}); diff --git a/modules/cheque/views/templates/front/payment_execution.tpl b/modules/cheque/views/templates/front/payment_execution.tpl index a85bbb48c..a6afee4b8 100644 --- a/modules/cheque/views/templates/front/payment_execution.tpl +++ b/modules/cheque/views/templates/front/payment_execution.tpl @@ -82,7 +82,7 @@ {*By webkul To Check Order restrict condition before Payment by the customer*} {if !$restrict_order} - {/if} diff --git a/themes/hotel-reservation-theme/modules/bankwire/views/templates/front/payment_execution.tpl b/themes/hotel-reservation-theme/modules/bankwire/views/templates/front/payment_execution.tpl index 148c11978..835542afe 100644 --- a/themes/hotel-reservation-theme/modules/bankwire/views/templates/front/payment_execution.tpl +++ b/themes/hotel-reservation-theme/modules/bankwire/views/templates/front/payment_execution.tpl @@ -90,7 +90,7 @@ {*By webkul To Check Order restrict condition before Payment by the customer*} {if !$restrict_order} - {/if} diff --git a/themes/hotel-reservation-theme/modules/cheque/views/templates/front/payment_execution.tpl b/themes/hotel-reservation-theme/modules/cheque/views/templates/front/payment_execution.tpl index 9d373466b..8fff68f8e 100644 --- a/themes/hotel-reservation-theme/modules/cheque/views/templates/front/payment_execution.tpl +++ b/themes/hotel-reservation-theme/modules/cheque/views/templates/front/payment_execution.tpl @@ -82,7 +82,7 @@ {*By webkul To Check Order restrict condition before Payment by the customer*} {if !$restrict_order} - {/if}