From e2c69b091ab37a8a9ff983a8a3b4b77559a7cb3f Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 4 Jun 2025 10:59:44 +0530 Subject: [PATCH] Fixed: multiple requests are sent to admincustomer in case admin double clicks on the add new customer --- .../default/template/controllers/orders/form.tpl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 67e7ed00b..006dc6d77 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -885,9 +885,11 @@ }); } + let customerSearchAjax = ''; function searchCustomers() { - $.ajax({ + abortRunningAjax(customerSearchAjax);Add commentMore actions + customerSearchAjax = $.ajax({ type:"POST", url : "{$link->getAdminLink('AdminCustomers')}", async: true, @@ -927,6 +929,12 @@ }); } + function abortRunningAjax(ajaxVar) { + if (ajaxVar) { + ajaxVar.abort(); + } + } + function setupCustomer(idCustomer) { //$('#carts').show();// by webkul