optmized the code changes

This commit is contained in:
vishalsingh.qlo325
2025-04-22 12:56:19 +05:30
parent 5ca2d8ea86
commit 5d92fe50f2
6 changed files with 19 additions and 12 deletions

View File

@@ -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();
}
$(document).ready(function () {
$(document).on('click', '.confirm_order', function(e){
e.preventDefault();
$(e.target).attr('disabled', 'disabled');
$(e.target).closest('form').get(0).submit();
});
});

View File

@@ -90,7 +90,7 @@
</a>
{*By webkul To Check Order restrict condition before Payment by the customer*}
{if !$restrict_order}
<button class="btn pull-right button button-medium" type="submit" onClick="disableSubmitButton(this)">
<button class="btn pull-right button button-medium confirm_order" type="submit">
<span>{l s='I confirm my order' mod='bankwire'}&nbsp;<i class="icon-chevron-right right"></i></span>
</button>
{/if}

View File

@@ -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();
}
$(document).ready(function () {
$(document).on('click', '.confirm_order', function(e){
e.preventDefault();
$(e.target).attr('disabled', 'disabled');
$(e.target).closest('form').get(0).submit();
});
});

View File

@@ -82,7 +82,7 @@
</a>
{*By webkul To Check Order restrict condition before Payment by the customer*}
{if !$restrict_order}
<button class="btn pull-right button button-medium" type="submit" onClick="disableSubmitButton(this)">
<button class="btn pull-right button button-medium confirm_order" type="submit">
<span>{l s='I confirm my order' mod='cheque'}&nbsp;<i class="icon-chevron-right right"></i></span>
</button>
{/if}

View File

@@ -90,7 +90,7 @@
</a>
{*By webkul To Check Order restrict condition before Payment by the customer*}
{if !$restrict_order}
<button class="btn pull-right button button-medium" type="submit" onClick="disableSubmitButton(this)">
<button class="btn pull-right button button-medium confirm_order" type="submit">
<span>{l s='I confirm my order' mod='bankwire'}&nbsp;<i class="icon-chevron-right right"></i></span>
</button>
{/if}

View File

@@ -82,7 +82,7 @@
</a>
{*By webkul To Check Order restrict condition before Payment by the customer*}
{if !$restrict_order}
<button class="btn pull-right button button-medium" type="submit" onClick="disableSubmitButton(this)">
<button class="btn pull-right button button-medium confirm_order" type="submit">
<span>{l s='I confirm my order' mod='cheque'}&nbsp;<i class="icon-chevron-right right"></i></span>
</button>
{/if}