From b60a74884417231cd31d88192fbd6f773a9b3f9c Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 20 Jan 2025 16:37:41 +0530 Subject: [PATCH 1/2] Fixed: service products are not deselected if the rooms are not available for the selected date range --- .../js/modules/blockcart/ajax-cart.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js b/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js index d0698fa3e..c2fcf30fe 100644 --- a/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js +++ b/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js @@ -1267,12 +1267,14 @@ function crossselling_serialScroll() { }); } -function resetRoomtypeServices() { +function resetRoomtypeServices(refresh = true) { $('.room_demands_container').find('input.id_room_type_demand:checked').prop('checked', false).uniform(); $('#additional_products').empty(); $('#additional_products div') $('.remove_roomtype_product').text(select_txt).removeClass('btn-danger remove_roomtype_product').addClass('btn-success add_roomtype_product'); - BookingForm.refresh(); + if (refresh) { + BookingForm.refresh(); + } } function disableRoomTypeDemands(show) { @@ -1289,6 +1291,7 @@ function disableRoomTypeDemands(show) { function disableRoomTypeServices(disable) { if (disable) { + resetRoomtypeServices(false); $('#service_products_cont').find('button.add_roomtype_product').attr('disabled', 'disabled'); $('#service_products_cont').find('.qty_container .qty_direction a').attr('disabled', 'disabled'); } else { From f3391db29eca63028cc1b30f7ed73d1b0b8a8cfb Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 20 Jan 2025 19:25:58 +0530 Subject: [PATCH 2/2] Fixed: Extra demands remained selected even when rooms were unavailable for the selected date range in the front office. --- themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js b/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js index c2fcf30fe..8f672c73f 100644 --- a/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js +++ b/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js @@ -1281,6 +1281,7 @@ function disableRoomTypeDemands(show) { if (show) { $('.room_demands_container_overlay').show(); $('.room_demands_container').find('input:checkbox.id_room_type_demand').prop('checked', false); + $('.room_demand_block').find('.id_room_type_demand').prop('checked', false).parent().removeClass('checked'); $('.room_demands_container').find('input:checkbox.id_room_type_demand').attr('disabled', 'disabled'); } else { $('.room_demands_container_overlay').hide();