From f29320976882c21f92afffa32902da833dca621d Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 30 Jun 2025 13:49:47 +0530 Subject: [PATCH 1/2] Fixed: room is added twice in the order if admin clicks on the add room twice --- js/admin/orders.js | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/js/admin/orders.js b/js/admin/orders.js index 607c659ff..e9d05ad2f 100644 --- a/js/admin/orders.js +++ b/js/admin/orders.js @@ -758,33 +758,25 @@ function initRoomEvents() success : function(data) { if (data.result) { - if (data.refresh) - { - window.location.href = admin_order_tab_link + '&conf=3&vieworder&id_order=' + id_order; - return; - } - go = false; + window.location.href = admin_order_tab_link + '&conf=3&vieworder&id_order=' + id_order; //commented by webkul /*updateAmounts(data.order); updateInvoice(data.invoices); updateDocuments(data.documents_html); updateShipping(data.shipping_html);*/ - // Initialize all events - init(); - window.location.href = admin_order_tab_link + '&conf=3&vieworder&id_order=' + id_order; //End // $('.partial_refund_fields').hide(); - } - else - jAlert(data.error); + } else { + jAlert(data.error); + $('.submitAddRoom').removeAttr('disabled'); + $('#submitAddRoom').removeAttr('disabled'); + } }, error : function(XMLHttpRequest, textStatus, errorThrown) { jAlert("Impossible to add the room to the cart.\n\ntextStatus: '" + textStatus + "'\nerrorThrown: '" + errorThrown + "'\nresponseText:\n" + XMLHttpRequest.responseText); }, complete: function() { - $('.submitAddRoom').removeAttr('disabled'); - $('#submitAddRoom').removeAttr('disabled'); $(".loading_overlay").hide(); } }); From 8ceb03486f732b60528dc5e3f977e6ca4f2d889f Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 30 Jun 2025 15:55:51 +0530 Subject: [PATCH 2/2] Added loader to reallocation and swap process --- js/admin/reallocation.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/admin/reallocation.js b/js/admin/reallocation.js index 130e03c7c..7c7baf1aa 100644 --- a/js/admin/reallocation.js +++ b/js/admin/reallocation.js @@ -31,13 +31,17 @@ $(document).ready(function() { /*For reallocating rooms in the modal*/ $(document).on('click', '#realloc_allocated_rooms', function(e){ + $(".loading_overlay").show(); if (RoomReallocationModal.reallocate() == false) { + $(".loading_overlay").hide(); return false; } }); /*For swaping rooms in the modal*/ $(document).on('click', '#swap_allocated_rooms', function(){ + $(".loading_overlay").show(); if (RoomReallocationModal.swap() == false) { + $(".loading_overlay").hide(); return false; } });